home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / shadow-3.1.4.tar < prev    next >
Tape Archive  |  1992-04-04  |  670.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Tape Archive (archive/tar).

You can browse this item here: shadow-3.1.4.tar

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file POSIX tar archive (GNU) default
99% file POSIX tar archive (GNU), directory shadow-3.1.4/, mode 755 , uid 144 , gid 310 , size 0 , seconds 5167631435, user brendan, group systems default
98% file data default
62% TrID TAR - Tape ARchive (GNU) default
37% TrID TAR - Tape ARchive (directory) default
100% lsar Tar default
100% gt2 TAR Archiv gefunden (Auflistung ist deaktiviert) default
100% disktype GNU tar archive default
100% detectItEasy Archive: tar default
100% binwalkID POSIX tar archive (GNU), owner user name: ".1.4/" default
100% xdgMime application/x-tar default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 73 68 61 64 6f 77 2d 33 | 2e 31 2e 34 2f 00 00 00 |shadow-3|.1.4/...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 20 20 37 | 35 35 20 00 20 20 20 31 |.... 7|55 . 1|
|00000070| 34 34 20 00 20 20 20 33 | 31 30 20 00 20 20 20 20 |44 . 3|10 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 35 31 36 37 36 33 31 | 0 | 5167631|
|00000090| 34 33 35 20 20 31 32 32 | 32 33 00 20 35 00 00 00 |435 122|23. 5...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 20 20 | 00 62 72 65 6e 64 61 6e |.ustar |.brendan|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 73 79 73 74 65 6d 73 |........|.systems|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 73 68 61 64 6f 77 2d 33 | 2e 31 2e 34 2f 63 68 61 |shadow-3|.1.4/cha|
|00000210| 67 65 2e 31 00 00 00 00 | 00 00 00 00 00 00 00 00 |ge.1....|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00000270| 34 34 20 00 20 20 20 33 | 31 30 20 00 20 20 20 20 |44 . 3|10 . |
|00000280| 20 20 20 33 35 32 33 20 | 20 35 31 31 34 35 37 34 | 3523 | 5114574|
|00000290| 33 33 32 20 20 31 33 34 | 33 31 00 20 30 00 00 00 |332 134|31. 0...|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 75 73 74 61 72 20 20 | 00 62 72 65 6e 64 61 6e |.ustar |.brendan|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 73 79 73 74 65 6d 73 |........|.systems|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 2e 5c 22 20 43 6f 70 79 | 72 69 67 68 74 20 31 39 |.\" Copy|right 19|
|00000410| 39 30 2c 20 4a 6f 68 6e | 20 46 2e 20 48 61 75 67 |90, John| F. Haug|
|00000420| 68 20 49 49 0a 2e 5c 22 | 20 41 6c 6c 20 72 69 67 |h II..\"| All rig|
|00000430| 68 74 73 20 72 65 73 65 | 72 76 65 64 2e 0a 2e 5c |hts rese|rved...\|
|00000440| 22 0a 2e 5c 22 20 55 73 | 65 2c 20 64 75 70 6c 69 |"..\" Us|e, dupli|
|00000450| 63 61 74 69 6f 6e 2c 20 | 61 6e 64 20 64 69 73 63 |cation, |and disc|
|00000460| 6c 6f 73 75 72 65 20 70 | 72 6f 68 69 62 69 74 65 |losure p|rohibite|
|00000470| 64 20 77 69 74 68 6f 75 | 74 0a 2e 5c 22 20 74 68 |d withou|t..\" th|
|00000480| 65 20 65 78 70 72 65 73 | 73 20 77 72 69 74 74 65 |e expres|s writte|
|00000490| 6e 20 70 65 72 6d 69 73 | 73 69 6f 6e 20 6f 66 20 |n permis|sion of |
|000004a0| 74 68 65 20 61 75 74 68 | 6f 72 2e 0a 2e 5c 22 0a |the auth|or...\".|
|000004b0| 2e 5c 22 09 40 28 23 29 | 63 68 61 67 65 2e 31 09 |.\".@(#)|chage.1.|
|000004c0| 33 2e 31 09 30 39 3a 33 | 34 3a 31 34 09 31 31 2f |3.1.09:3|4:14.11/|
|000004d0| 32 31 2f 39 30 0a 2e 5c | 22 0a 2e 54 48 20 43 48 |21/90..\|"..TH CH|
|000004e0| 41 47 45 20 31 0a 2e 53 | 48 20 4e 41 4d 45 0a 63 |AGE 1..S|H NAME.c|
|000004f0| 68 61 67 65 20 5c 2d 20 | 63 68 61 6e 67 65 20 75 |hage \- |change u|
|00000500| 73 65 72 20 70 61 73 73 | 77 6f 72 64 20 65 78 70 |ser pass|word exp|
|00000510| 69 72 61 74 65 20 69 6e | 66 6f 72 6d 61 74 69 6f |irate in|formatio|
|00000520| 6e 0a 2e 53 48 20 53 59 | 4e 4f 50 53 49 53 0a 5c |n..SH SY|NOPSIS.\|
|00000530| 66 42 63 68 61 67 65 5c | 66 52 20 5b 20 5c 66 42 |fBchage\|fR [ \fB|
|00000540| 2d 6d 20 5c 66 49 6d 69 | 6e 64 61 79 73 5c 66 52 |-m \fImi|ndays\fR|
|00000550| 20 5d 20 5b 20 5c 66 42 | 2d 4d 20 5c 66 49 6d 61 | ] [ \fB|-M \fIma|
|00000560| 78 64 61 79 73 5c 66 52 | 20 5d 20 5b 20 5c 66 42 |xdays\fR| ] [ \fB|
|00000570| 2d 64 20 5c 66 49 6c 61 | 73 74 64 61 79 5c 66 52 |-d \fIla|stday\fR|
|00000580| 20 5d 20 5c 66 49 75 73 | 65 72 5c 66 52 0a 2e 53 | ] \fIus|er\fR..S|
|00000590| 48 20 44 45 53 43 52 49 | 50 54 49 4f 4e 0a 5c 66 |H DESCRI|PTION.\f|
|000005a0| 49 63 68 61 67 65 5c 66 | 20 63 68 61 6e 67 65 73 |Ichage\f| changes|
|000005b0| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 64 | the num|ber of d|
|000005c0| 61 79 73 20 62 65 74 77 | 65 65 6e 20 70 61 73 73 |ays betw|een pass|
|000005d0| 77 6f 72 64 20 63 68 61 | 6e 67 65 73 20 61 6e 64 |word cha|nges and|
|000005e0| 20 74 68 65 0a 64 61 74 | 65 20 6f 66 20 74 68 65 | the.dat|e of the|
|000005f0| 20 6c 61 73 74 20 70 61 | 73 73 77 6f 72 64 20 63 | last pa|ssword c|
|00000600| 68 61 6e 67 65 2e 0a 54 | 68 69 73 20 69 6e 66 6f |hange..T|his info|
|00000610| 72 6d 61 74 69 6f 6e 20 | 69 73 20 75 73 65 64 20 |rmation |is used |
|00000620| 62 79 20 74 68 65 20 73 | 79 73 74 65 6d 20 74 6f |by the s|ystem to|
|00000630| 20 64 65 74 65 72 6d 69 | 6e 65 20 77 68 65 6e 20 | determi|ne when |
|00000640| 61 20 75 73 65 72 20 6d | 75 73 74 0a 63 68 61 6e |a user m|ust.chan|
|00000650| 67 65 20 74 68 65 69 72 | 20 70 61 73 73 77 6f 72 |ge their| passwor|
|00000660| 64 2e 0a 54 68 65 20 5c | 66 49 63 68 61 67 65 5c |d..The \|fIchage\|
|00000670| 66 20 63 6f 6d 6d 61 6e | 64 20 69 73 20 72 65 73 |f comman|d is res|
|00000680| 74 72 69 63 74 65 64 20 | 74 6f 20 74 68 65 20 72 |tricted |to the r|
|00000690| 6f 6f 74 20 75 73 65 72 | 2e 0a 2e 50 50 0a 54 68 |oot user|...PP.Th|
|000006a0| 65 20 76 61 6c 75 65 20 | 6f 66 20 5c 66 49 6d 69 |e value |of \fImi|
|000006b0| 6e 64 61 79 73 5c 66 20 | 69 73 20 74 68 65 20 6d |ndays\f |is the m|
|000006c0| 69 6e 69 6d 75 6d 20 6e | 75 6d 62 65 72 20 6f 66 |inimum n|umber of|
|000006d0| 20 64 61 79 73 20 62 65 | 74 77 65 65 6e 0a 70 61 | days be|tween.pa|
|000006e0| 73 73 77 6f 72 64 20 63 | 68 61 6e 67 65 73 2e 0a |ssword c|hanges..|
|000006f0| 41 20 76 61 6c 75 65 20 | 6f 66 20 7a 65 72 6f 20 |A value |of zero |
|00000700| 66 6f 72 20 74 68 69 73 | 20 66 69 65 6c 64 20 69 |for this| field i|
|00000710| 6e 64 69 63 61 74 65 73 | 20 74 68 61 74 20 74 68 |ndicates| that th|
|00000720| 65 20 75 73 65 72 20 6d | 61 79 20 63 68 61 6e 67 |e user m|ay chang|
|00000730| 65 0a 68 65 72 20 70 61 | 73 73 77 6f 72 64 20 61 |e.her pa|ssword a|
|00000740| 74 20 61 6e 79 20 74 69 | 6d 65 2e 0a 2e 50 50 0a |t any ti|me...PP.|
|00000750| 54 68 65 20 76 61 6c 75 | 65 20 6f 66 20 5c 66 49 |The valu|e of \fI|
|00000760| 6d 61 78 64 61 79 73 5c | 66 20 69 73 20 74 68 65 |maxdays\|f is the|
|00000770| 20 6d 61 78 69 6d 75 6d | 20 6e 75 6d 62 65 72 20 | maximum| number |
|00000780| 6f 66 20 64 61 79 73 20 | 64 75 72 69 6e 67 0a 77 |of days |during.w|
|00000790| 68 69 63 68 20 61 20 70 | 61 73 73 77 6f 72 64 20 |hich a p|assword |
|000007a0| 69 73 20 76 61 6c 69 64 | 2e 0a 57 68 65 6e 20 5c |is valid|..When \|
|000007b0| 66 49 6d 61 78 64 61 79 | 73 5c 66 20 70 6c 75 73 |fImaxday|s\f plus|
|000007c0| 20 5c 66 49 6c 61 73 74 | 64 61 79 5c 66 20 69 73 | \fIlast|day\f is|
|000007d0| 20 6c 65 73 73 20 74 68 | 61 6e 20 74 68 65 20 63 | less th|an the c|
|000007e0| 75 72 72 65 6e 74 20 64 | 61 79 2c 0a 74 68 65 20 |urrent d|ay,.the |
|000007f0| 75 73 65 72 20 77 69 6c | 6c 20 62 65 20 72 65 71 |user wil|l be req|
|00000800| 75 69 72 65 64 20 74 6f | 20 63 68 61 6e 67 65 20 |uired to| change |
|00000810| 68 65 72 20 70 61 73 73 | 77 6f 72 64 20 62 65 66 |her pass|word bef|
|00000820| 6f 72 65 20 62 65 69 6e | 67 0a 61 62 6c 65 20 74 |ore bein|g.able t|
|00000830| 6f 20 75 73 65 20 68 65 | 72 20 61 63 63 6f 75 6e |o use he|r accoun|
|00000840| 74 2e 0a 2e 50 50 0a 54 | 68 65 20 76 61 6c 75 65 |t...PP.T|he value|
|00000850| 20 6f 66 20 5c 66 49 6c | 61 73 74 64 61 79 5c 66 | of \fIl|astday\f|
|00000860| 20 69 73 20 74 68 65 20 | 6e 75 6d 62 65 72 20 6f | is the |number o|
|00000870| 66 20 64 61 79 73 20 73 | 69 6e 63 65 20 4a 61 6e |f days s|ince Jan|
|00000880| 75 61 72 79 20 31 73 74 | 2c 0a 31 39 37 30 20 77 |uary 1st|,.1970 w|
|00000890| 68 65 6e 20 74 68 65 20 | 70 61 73 73 77 6f 72 64 |hen the |password|
|000008a0| 20 77 61 73 20 6c 61 73 | 74 20 63 68 61 6e 67 65 | was las|t change|
|000008b0| 64 2e 0a 2e 50 50 0a 41 | 6c 6c 20 6f 66 20 74 68 |d...PP.A|ll of th|
|000008c0| 65 20 61 62 6f 76 65 20 | 76 61 6c 75 65 73 20 61 |e above |values a|
|000008d0| 72 65 20 73 74 6f 72 65 | 64 20 65 78 61 63 74 6c |re store|d exactl|
|000008e0| 79 20 61 73 20 64 61 79 | 73 20 77 68 65 6e 20 74 |y as day|s when t|
|000008f0| 68 65 20 73 68 61 64 6f | 77 0a 70 61 73 73 77 6f |he shado|w.passwo|
|00000900| 72 64 20 66 69 6c 65 20 | 69 73 20 75 73 65 64 2c |rd file |is used,|
|00000910| 20 62 75 74 20 61 72 65 | 20 63 6f 6e 76 65 72 74 | but are| convert|
|00000920| 65 64 20 74 6f 20 61 6e | 64 20 66 72 6f 6d 20 77 |ed to an|d from w|
|00000930| 65 65 6b 73 20 77 68 65 | 6e 20 74 68 65 0a 73 74 |eeks whe|n the.st|
|00000940| 61 6e 64 61 72 64 20 70 | 61 73 73 77 6f 72 64 20 |andard p|assword |
|00000950| 66 69 6c 65 20 69 73 20 | 75 73 65 64 2e 0a 42 65 |file is |used..Be|
|00000960| 63 61 75 73 65 20 6f 66 | 20 74 68 69 73 20 63 6f |cause of| this co|
|00000970| 6e 76 65 72 73 69 6f 6e | 2c 20 72 6f 75 6e 64 69 |nversion|, roundi|
|00000980| 6e 67 20 65 72 72 6f 72 | 73 20 6d 61 79 20 72 65 |ng error|s may re|
|00000990| 73 75 6c 74 2e 0a 2e 50 | 50 0a 49 66 20 6e 6f 6e |sult...P|P.If non|
|000009a0| 65 20 6f 66 20 74 68 65 | 20 6f 70 74 69 6f 6e 73 |e of the| options|
|000009b0| 20 61 72 65 20 73 65 6c | 65 63 74 65 64 2c 20 5c | are sel|ected, \|
|000009c0| 66 49 63 68 61 67 65 5c | 66 20 6f 70 65 72 61 74 |fIchage\|f operat|
|000009d0| 65 73 20 69 6e 20 61 6e | 20 69 6e 74 65 72 61 63 |es in an| interac|
|000009e0| 74 69 76 65 0a 66 61 73 | 68 69 6f 6e 2c 20 70 72 |tive.fas|hion, pr|
|000009f0| 6f 6d 70 74 69 6e 67 20 | 74 68 65 20 75 73 65 72 |ompting |the user|
|00000a00| 20 77 69 74 68 20 74 68 | 65 20 63 75 72 72 65 6e | with th|e curren|
|00000a10| 74 20 76 61 6c 75 65 73 | 20 66 6f 72 20 61 6c 6c |t values| for all|
|00000a20| 20 6f 66 20 74 68 65 20 | 66 69 65 6c 64 73 2e 0a | of the |fields..|
|00000a30| 45 6e 74 65 72 20 74 68 | 65 20 6e 65 77 20 76 61 |Enter th|e new va|
|00000a40| 6c 75 65 20 74 6f 20 63 | 68 61 6e 67 65 20 74 68 |lue to c|hange th|
|00000a50| 65 20 66 69 65 6c 64 2c | 20 6f 72 20 6c 65 61 76 |e field,| or leav|
|00000a60| 65 20 74 68 65 20 6c 69 | 6e 65 20 62 6c 61 6e 6b |e the li|ne blank|
|00000a70| 20 74 6f 20 75 73 65 0a | 74 68 65 20 63 75 72 72 | to use.|the curr|
|00000a80| 65 6e 74 20 76 61 6c 75 | 65 2e 0a 54 68 65 20 63 |ent valu|e..The c|
|00000a90| 75 72 72 65 6e 74 20 76 | 61 6c 75 65 20 69 73 20 |urrent v|alue is |
|00000aa0| 64 69 73 70 6c 61 79 65 | 64 20 62 65 74 77 65 65 |displaye|d betwee|
|00000ab0| 6e 20 61 20 70 61 69 72 | 20 6f 66 20 5c 66 42 5b |n a pair| of \fB[|
|00000ac0| 20 5d 5c 66 20 6d 61 72 | 6b 73 2e 0a 2e 53 48 20 | ]\f mar|ks...SH |
|00000ad0| 46 69 6c 65 73 0a 2f 65 | 74 63 2f 70 61 73 73 77 |Files./e|tc/passw|
|00000ae0| 64 20 5c 2d 20 75 73 65 | 72 20 61 63 63 6f 75 6e |d \- use|r accoun|
|00000af0| 74 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 0a 2e 62 |t inform|ation..b|
|00000b00| 72 0a 2f 65 74 63 2f 73 | 68 61 64 6f 77 20 5c 2d |r./etc/s|hadow \-|
|00000b10| 20 73 68 61 64 6f 77 20 | 75 73 65 72 20 61 63 63 | shadow |user acc|
|00000b20| 6f 75 6e 74 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |ount inf|ormation|
|00000b30| 0a 2e 53 48 20 53 65 65 | 20 41 6c 73 6f 0a 70 61 |..SH See| Also.pa|
|00000b40| 73 73 77 64 28 34 29 2c | 0a 73 68 61 64 6f 77 28 |sswd(4),|.shadow(|
|00000b50| 34 29 0a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |4)......|........|
|00000b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c00| 73 68 61 64 6f 77 2d 33 | 2e 31 2e 34 2f 63 68 61 |shadow-3|.1.4/cha|
|00000c10| 67 65 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |ge.c....|........|
|00000c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00000c70| 34 34 20 00 20 20 20 33 | 31 30 20 00 20 20 20 20 |44 . 3|10 . |
|00000c80| 20 20 34 31 37 36 35 20 | 20 35 31 31 34 35 37 34 | 41765 | 5114574|
|00000c90| 32 37 33 20 20 31 33 35 | 35 31 00 20 30 00 00 00 |273 135|51. 0...|
|00000ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d00| 00 75 73 74 61 72 20 20 | 00 62 72 65 6e 64 61 6e |.ustar |.brendan|
|00000d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d20| 00 00 00 00 00 00 00 00 | 00 73 79 73 74 65 6d 73 |........|.systems|
|00000d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e00| 2f 2a 0a 20 2a 20 43 6f | 70 79 72 69 67 68 74 20 |/*. * Co|pyright |
|00000e10| 31 39 38 39 2c 20 31 39 | 39 30 2c 20 31 39 39 31 |1989, 19|90, 1991|
|00000e20| 2c 20 4a 6f 68 6e 20 46 | 2e 20 48 61 75 67 68 20 |, John F|. Haugh |
|00000e30| 49 49 0a 20 2a 20 41 6c | 6c 20 72 69 67 68 74 73 |II. * Al|l rights|
|00000e40| 20 72 65 73 65 72 76 65 | 64 2e 0a 20 2a 0a 20 2a | reserve|d.. *. *|
|00000e50| 20 50 65 72 6d 69 73 73 | 69 6f 6e 20 69 73 20 67 | Permiss|ion is g|
|00000e60| 72 61 6e 74 65 64 20 74 | 6f 20 63 6f 70 79 20 61 |ranted t|o copy a|
|00000e70| 6e 64 20 63 72 65 61 74 | 65 20 64 65 72 69 76 61 |nd creat|e deriva|
|00000e80| 74 69 76 65 20 77 6f 72 | 6b 73 20 66 6f 72 20 61 |tive wor|ks for a|
|00000e90| 6e 79 0a 20 2a 20 6e 6f | 6e 2d 63 6f 6d 6d 65 72 |ny. * no|n-commer|
|00000ea0| 63 69 61 6c 20 70 75 72 | 70 6f 73 65 2c 20 70 72 |cial pur|pose, pr|
|00000eb0| 6f 76 69 64 65 64 20 74 | 68 69 73 20 63 6f 70 79 |ovided t|his copy|
|00000ec0| 72 69 67 68 74 20 6e 6f | 74 69 63 65 20 69 73 20 |right no|tice is |
|00000ed0| 70 72 65 73 65 72 76 65 | 64 0a 20 2a 20 69 6e 20 |preserve|d. * in |
|00000ee0| 61 6c 6c 20 63 6f 70 69 | 65 73 20 6f 66 20 73 6f |all copi|es of so|
|00000ef0| 75 72 63 65 20 63 6f 64 | 65 2c 20 6f 72 20 69 6e |urce cod|e, or in|
|00000f00| 63 6c 75 64 65 64 20 69 | 6e 20 68 75 6d 61 6e 20 |cluded i|n human |
|00000f10| 72 65 61 64 61 62 6c 65 | 20 66 6f 72 6d 0a 20 2a |readable| form. *|
|00000f20| 20 61 6e 64 20 63 6f 6e | 73 70 69 63 75 6f 75 73 | and con|spicuous|
|00000f30| 6c 79 20 64 69 73 70 6c | 61 79 65 64 20 6f 6e 20 |ly displ|ayed on |
|00000f40| 61 6c 6c 20 63 6f 70 69 | 65 73 20 6f 66 20 6f 62 |all copi|es of ob|
|00000f50| 6a 65 63 74 20 63 6f 64 | 65 20 6f 72 0a 20 2a 20 |ject cod|e or. * |
|00000f60| 64 69 73 74 72 69 62 75 | 74 69 6f 6e 20 6d 65 64 |distribu|tion med|
|00000f70| 69 61 2e 0a 20 2a 2f 0a | 0a 23 69 6e 63 6c 75 64 |ia.. */.|.#includ|
|00000f80| 65 20 3c 73 79 73 2f 74 | 79 70 65 73 2e 68 3e 0a |e <sys/t|ypes.h>.|
|00000f90| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 69 6f 2e |#include| <stdio.|
|00000fa0| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 66 63 6e |h>.#incl|ude <fcn|
|00000fb0| 74 6c 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |tl.h>.#i|nclude <|
|00000fc0| 73 69 67 6e 61 6c 2e 68 | 3e 0a 23 69 6e 63 6c 75 |signal.h|>.#inclu|
|00000fd0| 64 65 20 3c 63 74 79 70 | 65 2e 68 3e 0a 23 69 6e |de <ctyp|e.h>.#in|
|00000fe0| 63 6c 75 64 65 20 3c 74 | 69 6d 65 2e 68 3e 0a 0a |clude <t|ime.h>..|
|00000ff0| 23 69 66 6e 64 65 66 09 | 6c 69 6e 74 0a 73 74 61 |#ifndef.|lint.sta|
|00001000| 74 69 63 09 63 68 61 72 | 09 73 63 63 73 69 64 5b |tic.char|.sccsid[|
|00001010| 5d 20 3d 20 22 40 28 23 | 29 63 68 61 67 65 2e 63 |] = "@(#|)chage.c|
|00001020| 09 33 2e 39 09 31 30 3a | 31 34 3a 33 30 09 38 2f |.3.9.10:|14:30.8/|
|00001030| 31 35 2f 39 31 22 3b 0a | 23 65 6e 64 69 66 0a 0a |15/91";.|#endif..|
|00001040| 2f 2a 0a 20 2a 20 53 65 | 74 20 75 70 20 73 6f 6d |/*. * Se|t up som|
|00001050| 65 20 42 53 44 20 64 65 | 66 69 6e 65 73 20 73 6f |e BSD de|fines so|
|00001060| 20 74 68 61 74 20 61 6c | 6c 20 74 68 65 20 42 53 | that al|l the BS|
|00001070| 44 20 69 66 64 65 66 27 | 73 20 61 72 65 0a 20 2a |D ifdef'|s are. *|
|00001080| 20 6b 65 70 74 20 72 69 | 67 68 74 20 68 65 72 65 | kept ri|ght here|
|00001090| 20 0a 20 2a 2f 0a 0a 23 | 69 66 6e 64 65 66 09 42 | . */..#|ifndef.B|
|000010a0| 53 44 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 74 72 |SD.#incl|ude <str|
|000010b0| 69 6e 67 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |ing.h>.#|include |
|000010c0| 3c 6d 65 6d 6f 72 79 2e | 68 3e 0a 23 64 65 66 69 |<memory.|h>.#defi|
|000010d0| 6e 65 09 62 7a 65 72 6f | 28 61 2c 6e 29 09 6d 65 |ne.bzero|(a,n).me|
|000010e0| 6d 73 65 74 28 61 2c 20 | 30 2c 20 6e 29 0a 23 65 |mset(a, |0, n).#e|
|000010f0| 6c 73 65 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |lse.#inc|lude <st|
|00001100| 72 69 6e 67 73 2e 68 3e | 0a 23 64 65 66 69 6e 65 |rings.h>|.#define|
|00001110| 09 73 74 72 63 68 72 09 | 69 6e 64 65 78 0a 23 64 |.strchr.|index.#d|
|00001120| 65 66 69 6e 65 09 73 74 | 72 72 63 68 72 09 72 69 |efine.st|rrchr.ri|
|00001130| 6e 64 65 78 0a 23 65 6e | 64 69 66 0a 0a 23 69 6e |ndex.#en|dif..#in|
|00001140| 63 6c 75 64 65 20 22 63 | 6f 6e 66 69 67 2e 68 22 |clude "c|onfig.h"|
|00001150| 0a 23 69 6e 63 6c 75 64 | 65 20 22 70 77 64 2e 68 |.#includ|e "pwd.h|
|00001160| 22 0a 23 69 6e 63 6c 75 | 64 65 20 22 73 68 61 64 |".#inclu|de "shad|
|00001170| 6f 77 2e 68 22 0a 0a 23 | 69 66 64 65 66 09 55 53 |ow.h"..#|ifdef.US|
|00001180| 45 5f 53 59 53 4c 4f 47 | 0a 23 69 6e 63 6c 75 64 |E_SYSLOG|.#includ|
|00001190| 65 20 3c 73 79 73 6c 6f | 67 2e 68 3e 0a 0a 23 69 |e <syslo|g.h>..#i|
|000011a0| 66 6e 64 65 66 09 4c 4f | 47 5f 57 41 52 4e 0a 23 |fndef.LO|G_WARN.#|
|000011b0| 64 65 66 69 6e 65 09 4c | 4f 47 5f 57 41 52 4e 20 |define.L|OG_WARN |
|000011c0| 4c 4f 47 5f 57 41 52 4e | 49 4e 47 0a 23 65 6e 64 |LOG_WARN|ING.#end|
|000011d0| 69 66 09 2f 2a 20 21 4c | 4f 47 5f 57 41 52 4e 20 |if./* !L|OG_WARN |
|000011e0| 2a 2f 0a 23 65 6e 64 69 | 66 09 2f 2a 20 55 53 45 |*/.#endi|f./* USE|
|000011f0| 5f 53 59 53 4c 4f 47 20 | 2a 2f 0a 0a 2f 2a 0a 20 |_SYSLOG |*/../*. |
|00001200| 2a 20 47 6c 6f 62 61 6c | 20 76 61 72 69 61 62 6c |* Global| variabl|
|00001210| 65 73 0a 20 2a 2f 0a 0a | 63 68 61 72 09 2a 50 72 |es. */..|char.*Pr|
|00001220| 6f 67 3b 0a 6c 6f 6e 67 | 09 6d 69 6e 64 61 79 73 |og;.long|.mindays|
|00001230| 3b 0a 6c 6f 6e 67 09 6d | 61 78 64 61 79 73 3b 0a |;.long.m|axdays;.|
|00001240| 6c 6f 6e 67 09 6c 61 73 | 74 64 61 79 3b 0a 6c 6f |long.las|tday;.lo|
|00001250| 6e 67 09 77 61 72 6e 64 | 61 79 73 3b 0a 6c 6f 6e |ng.warnd|ays;.lon|
|00001260| 67 09 69 6e 61 63 74 64 | 61 79 73 3b 0a 6c 6f 6e |g.inactd|ays;.lon|
|00001270| 67 09 65 78 70 64 61 79 | 73 3b 0a 76 6f 69 64 09 |g.expday|s;.void.|
|00001280| 63 6c 65 61 6e 75 70 28 | 29 3b 0a 0a 2f 2a 0a 20 |cleanup(|);../*. |
|00001290| 2a 20 45 78 74 65 72 6e | 61 6c 20 69 64 65 6e 74 |* Extern|al ident|
|000012a0| 69 66 69 65 72 73 0a 20 | 2a 2f 0a 0a 65 78 74 65 |ifiers. |*/..exte|
|000012b0| 72 6e 09 6c 6f 6e 67 09 | 61 36 34 6c 28 29 3b 0a |rn.long.|a64l();.|
|000012c0| 65 78 74 65 72 6e 09 69 | 6e 74 09 70 77 5f 6c 6f |extern.i|nt.pw_lo|
|000012d0| 63 6b 28 29 2c 20 70 77 | 5f 6f 70 65 6e 28 29 2c |ck(), pw|_open(),|
|000012e0| 0a 09 09 70 77 5f 75 6e | 6c 6f 63 6b 28 29 2c 20 |...pw_un|lock(), |
|000012f0| 70 77 5f 63 6c 6f 73 65 | 28 29 2c 0a 09 09 70 77 |pw_close|(),...pw|
|00001300| 5f 75 70 64 61 74 65 28 | 29 3b 0a 65 78 74 65 72 |_update(|);.exter|
|00001310| 6e 09 73 74 72 75 63 74 | 09 70 61 73 73 77 64 09 |n.struct|.passwd.|
|00001320| 2a 70 77 5f 6c 6f 63 61 | 74 65 28 29 3b 0a 65 78 |*pw_loca|te();.ex|
|00001330| 74 65 72 6e 09 69 6e 74 | 09 73 70 77 5f 6c 6f 63 |tern.int|.spw_loc|
|00001340| 6b 28 29 2c 20 73 70 77 | 5f 6f 70 65 6e 28 29 2c |k(), spw|_open(),|
|00001350| 0a 09 09 73 70 77 5f 75 | 6e 6c 6f 63 6b 28 29 2c |...spw_u|nlock(),|
|00001360| 20 73 70 77 5f 63 6c 6f | 73 65 28 29 2c 0a 09 09 | spw_clo|se(),...|
|00001370| 73 70 77 5f 75 70 64 61 | 74 65 28 29 3b 0a 65 78 |spw_upda|te();.ex|
|00001380| 74 65 72 6e 09 73 74 72 | 75 63 74 09 73 70 77 64 |tern.str|uct.spwd|
|00001390| 09 2a 73 70 77 5f 6c 6f | 63 61 74 65 28 29 3b 0a |.*spw_lo|cate();.|
|000013a0| 65 78 74 65 72 6e 09 69 | 6e 74 09 6f 70 74 69 6e |extern.i|nt.optin|
|000013b0| 64 3b 0a 65 78 74 65 72 | 6e 09 63 68 61 72 09 2a |d;.exter|n.char.*|
|000013c0| 6f 70 74 61 72 67 3b 0a | 65 78 74 65 72 6e 09 63 |optarg;.|extern.c|
|000013d0| 68 61 72 09 2a 67 65 74 | 6c 6f 67 69 6e 20 28 29 |har.*get|login ()|
|000013e0| 3b 0a 23 69 66 64 65 66 | 09 4e 44 42 4d 0a 65 78 |;.#ifdef|.NDBM.ex|
|000013f0| 74 65 72 6e 09 69 6e 74 | 09 70 77 5f 64 62 6d 5f |tern.int|.pw_dbm_|
|00001400| 6d 6f 64 65 3b 0a 65 78 | 74 65 72 6e 09 69 6e 74 |mode;.ex|tern.int|
|00001410| 09 73 70 5f 64 62 6d 5f | 6d 6f 64 65 3b 0a 23 65 |.sp_dbm_|mode;.#e|
|00001420| 6e 64 69 66 0a 0a 2f 2a | 0a 20 2a 20 50 61 73 73 |ndif../*|. * Pass|
|00001430| 77 6f 72 64 20 61 67 69 | 6e 67 20 63 6f 6e 73 74 |word agi|ng const|
|00001440| 61 6e 74 73 0a 20 2a 0a | 20 2a 09 44 41 59 20 2d |ants. *.| *.DAY -|
|00001450| 20 73 65 63 6f 6e 64 73 | 20 69 6e 20 61 20 64 61 | seconds| in a da|
|00001460| 79 0a 20 2a 09 57 45 45 | 4b 20 2d 20 73 65 63 6f |y. *.WEE|K - seco|
|00001470| 6e 64 73 20 69 6e 20 61 | 20 77 65 65 6b 0a 20 2a |nds in a| week. *|
|00001480| 09 53 43 41 4c 45 20 2d | 20 63 6f 6e 76 65 72 74 |.SCALE -| convert|
|00001490| 20 66 72 6f 6d 20 63 6c | 6f 63 6b 20 74 6f 20 61 | from cl|ock to a|
|000014a0| 67 69 6e 67 20 75 6e 69 | 74 73 0a 20 2a 2f 0a 0a |ging uni|ts. */..|
|000014b0| 23 64 65 66 69 6e 65 09 | 44 41 59 09 28 32 34 4c |#define.|DAY.(24L|
|000014c0| 2a 33 36 30 30 4c 29 0a | 23 64 65 66 69 6e 65 09 |*3600L).|#define.|
|000014d0| 57 45 45 4b 09 28 37 2a | 44 41 59 29 0a 0a 23 69 |WEEK.(7*|DAY)..#i|
|000014e0| 66 64 65 66 09 49 54 49 | 5f 41 47 49 4e 47 0a 23 |fdef.ITI|_AGING.#|
|000014f0| 64 65 66 69 6e 65 09 53 | 43 41 4c 45 09 28 31 29 |define.S|CALE.(1)|
|00001500| 0a 23 65 6c 73 65 0a 23 | 64 65 66 69 6e 65 09 53 |.#else.#|define.S|
|00001510| 43 41 4c 45 09 28 44 41 | 59 29 0a 23 65 6e 64 69 |CALE.(DA|Y).#endi|
|00001520| 66 0a 0a 2f 2a 0a 20 2a | 20 64 61 79 73 20 61 6e |f../*. *| days an|
|00001530| 64 20 6a 75 6c 64 61 79 | 73 20 61 72 65 20 75 73 |d julday|s are us|
|00001540| 65 64 20 74 6f 20 63 6f | 6d 70 75 74 65 20 74 68 |ed to co|mpute th|
|00001550| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 64 61 79 73 |e number| of days|
|00001560| 20 69 6e 20 74 68 65 0a | 20 2a 20 63 75 72 72 65 | in the.| * curre|
|00001570| 6e 74 20 6d 6f 6e 74 68 | 2c 20 61 6e 64 20 74 68 |nt month|, and th|
|00001580| 65 20 63 75 6d 6d 75 6c | 61 74 69 76 65 20 6e 75 |e cummul|ative nu|
|00001590| 6d 62 65 72 20 6f 66 20 | 64 61 79 73 20 69 6e 20 |mber of |days in |
|000015a0| 74 68 65 20 70 72 65 63 | 65 64 69 6e 67 0a 20 2a |the prec|eding. *|
|000015b0| 20 6d 6f 6e 74 68 73 2e | 20 20 74 68 65 79 20 61 | months.| they a|
|000015c0| 72 65 20 64 65 63 6c 61 | 72 65 64 20 73 6f 20 74 |re decla|red so t|
|000015d0| 68 61 74 20 6a 61 6e 75 | 61 72 79 20 69 73 20 31 |hat janu|ary is 1|
|000015e0| 2c 20 6e 6f 74 20 30 2e | 0a 20 2a 2f 0a 0a 73 74 |, not 0.|. */..st|
|000015f0| 61 74 69 63 09 73 68 6f | 72 74 09 64 61 79 73 5b |atic.sho|rt.days[|
|00001600| 31 33 5d 20 3d 20 7b 20 | 30 2c 0a 09 33 31 2c 09 |13] = { |0,..31,.|
|00001610| 32 38 2c 09 33 31 2c 09 | 33 30 2c 09 33 31 2c 09 |28,.31,.|30,.31,.|
|00001620| 33 30 2c 09 2f 2a 20 4a | 41 4e 20 2d 20 4a 55 4e |30,./* J|AN - JUN|
|00001630| 20 2a 2f 0a 09 33 31 2c | 09 33 31 2c 09 33 30 2c | */..31,|.31,.30,|
|00001640| 09 33 31 2c 09 33 30 2c | 09 33 31 20 7d 3b 09 2f |.31,.30,|.31 };./|
|00001650| 2a 20 4a 55 4c 20 2d 20 | 44 45 43 20 2a 2f 0a 0a |* JUL - |DEC */..|
|00001660| 73 74 61 74 69 63 09 73 | 68 6f 72 74 09 6a 75 6c |static.s|hort.jul|
|00001670| 64 61 79 73 5b 31 33 5d | 20 3d 20 7b 20 30 2c 0a |days[13]| = { 0,.|
|00001680| 09 30 2c 09 33 31 2c 09 | 35 39 2c 09 39 30 2c 09 |.0,.31,.|59,.90,.|
|00001690| 31 32 30 2c 09 31 35 31 | 2c 09 2f 2a 20 4a 41 4e |120,.151|,./* JAN|
|000016a0| 20 2d 20 4a 55 4e 20 2a | 2f 0a 09 31 38 31 2c 09 | - JUN *|/..181,.|
|000016b0| 32 31 32 2c 09 32 34 33 | 2c 09 32 37 33 2c 09 33 |212,.243|,.273,.3|
|000016c0| 30 34 2c 09 33 33 34 20 | 7d 3b 09 2f 2a 20 4a 55 |04,.334 |};./* JU|
|000016d0| 4c 20 2d 20 44 45 43 20 | 2a 2f 0a 0a 2f 2a 0a 20 |L - DEC |*/../*. |
|000016e0| 2a 20 23 64 65 66 69 6e | 65 73 20 66 6f 72 20 6d |* #defin|es for m|
|000016f0| 65 73 73 61 67 65 73 2e | 20 20 54 68 69 73 20 66 |essages.| This f|
|00001700| 61 63 69 6c 69 74 69 65 | 73 20 66 6f 72 65 69 67 |acilitie|s foreig|
|00001710| 6e 20 6c 61 6e 67 75 61 | 67 65 20 63 6f 6e 76 65 |n langua|ge conve|
|00001720| 72 73 69 6f 6e 0a 20 2a | 20 73 69 6e 63 65 20 61 |rsion. *| since a|
|00001730| 6c 6c 20 6d 65 73 73 61 | 67 65 73 20 61 72 65 20 |ll messa|ges are |
|00001740| 64 65 66 69 6e 65 64 20 | 72 69 67 68 74 20 68 65 |defined |right he|
|00001750| 72 65 2e 0a 20 2a 2f 0a | 0a 23 64 65 66 69 6e 65 |re.. */.|.#define|
|00001760| 09 55 53 41 47 45 20 5c | 0a 22 55 73 61 67 65 3a |.USAGE \|."Usage:|
|00001770| 20 25 73 20 5b 20 2d 6c | 20 5d 20 5b 20 2d 6d 20 | %s [ -l| ] [ -m |
|00001780| 6d 69 6e 5f 64 61 79 73 | 20 5d 20 5b 20 2d 4d 20 |min_days| ] [ -M |
|00001790| 6d 61 78 5f 64 61 79 73 | 20 5d 20 5b 20 2d 57 20 |max_days| ] [ -W |
|000017a0| 77 61 72 6e 20 5d 5c 6e | 5c 0a 20 20 20 20 20 20 |warn ]\n|\. |
|000017b0| 20 5b 20 2d 49 20 69 6e | 61 63 74 69 76 65 20 5d | [ -I in|active ]|
|000017c0| 20 5b 20 2d 45 20 65 78 | 70 69 72 65 20 5d 20 5b | [ -E ex|pire ] [|
|000017d0| 20 2d 64 20 6c 61 73 74 | 5f 64 61 79 20 5d 20 75 | -d last|_day ] u|
|000017e0| 73 65 72 5c 6e 22 0a 23 | 64 65 66 69 6e 65 09 44 |ser\n".#|define.D|
|000017f0| 42 4d 45 52 52 4f 52 09 | 22 45 72 72 6f 72 20 75 |BMERROR.|"Error u|
|00001800| 70 64 61 74 69 6e 67 20 | 74 68 65 20 44 42 4d 20 |pdating |the DBM |
|00001810| 70 61 73 73 77 6f 72 64 | 20 65 6e 74 72 79 2e 5c |password| entry.\|
|00001820| 6e 22 0a 23 64 65 66 69 | 6e 65 09 44 42 4d 45 52 |n".#defi|ne.DBMER|
|00001830| 52 4f 52 32 09 22 65 72 | 72 6f 72 20 75 70 64 61 |ROR2."er|ror upda|
|00001840| 74 69 6e 67 20 44 42 4d | 20 73 68 61 64 6f 77 20 |ting DBM| shadow |
|00001850| 65 6e 74 72 79 2e 5c 6e | 22 0a 23 64 65 66 69 6e |entry.\n|".#defin|
|00001860| 65 09 55 4e 4b 5f 55 53 | 45 52 09 22 25 73 3a 20 |e.UNK_US|ER."%s: |
|00001870| 75 6e 6b 6e 6f 77 6e 20 | 75 73 65 72 3a 20 25 73 |unknown |user: %s|
|00001880| 5c 6e 22 0a 23 64 65 66 | 69 6e 65 09 4e 4f 5f 4c |\n".#def|ine.NO_L|
|00001890| 46 4c 41 47 09 22 25 73 | 3a 20 64 6f 20 6e 6f 20 |FLAG."%s|: do no |
|000018a0| 69 6e 63 6c 75 64 65 20 | 5c 22 6c 5c 22 20 77 69 |include |\"l\" wi|
|000018b0| 74 68 20 6f 74 68 65 72 | 20 66 6c 61 67 73 5c 6e |th other| flags\n|
|000018c0| 22 0a 23 64 65 66 69 6e | 65 09 4e 4f 5f 50 45 52 |".#defin|e.NO_PER|
|000018d0| 4d 09 09 22 25 73 3a 20 | 70 65 72 6d 69 73 73 69 |M.."%s: |permissi|
|000018e0| 6f 6e 20 64 65 6e 69 65 | 64 5c 6e 22 0a 23 64 65 |on denie|d\n".#de|
|000018f0| 66 69 6e 65 09 4e 4f 5f | 50 57 4c 4f 43 4b 09 22 |fine.NO_|PWLOCK."|
|00001900| 25 73 3a 20 63 61 6e 27 | 74 20 6c 6f 63 6b 20 70 |%s: can'|t lock p|
|00001910| 61 73 73 77 6f 72 64 20 | 66 69 6c 65 5c 6e 22 0a |assword |file\n".|
|00001920| 23 64 65 66 69 6e 65 09 | 4e 4f 5f 53 50 4c 4f 43 |#define.|NO_SPLOC|
|00001930| 4b 09 22 25 73 3a 20 63 | 61 6e 27 74 20 6c 6f 63 |K."%s: c|an't loc|
|00001940| 6b 20 73 68 61 64 6f 77 | 20 70 61 73 73 77 6f 72 |k shadow| passwor|
|00001950| 64 20 66 69 6c 65 5c 6e | 22 0a 23 64 65 66 69 6e |d file\n|".#defin|
|00001960| 65 09 4e 4f 5f 50 57 4f | 50 45 4e 09 22 25 73 3a |e.NO_PWO|PEN."%s:|
|00001970| 20 63 61 6e 27 74 20 6f | 70 65 6e 20 70 61 73 73 | can't o|pen pass|
|00001980| 77 6f 72 64 20 66 69 6c | 65 5c 6e 22 0a 23 64 65 |word fil|e\n".#de|
|00001990| 66 69 6e 65 09 4e 4f 5f | 53 50 4f 50 45 4e 09 22 |fine.NO_|SPOPEN."|
|000019a0| 25 73 3a 20 63 61 6e 27 | 74 20 6f 70 65 6e 20 73 |%s: can'|t open s|
|000019b0| 68 61 64 6f 77 20 70 61 | 73 73 77 6f 72 64 20 66 |hadow pa|ssword f|
|000019c0| 69 6c 65 5c 6e 22 0a 23 | 64 65 66 69 6e 65 09 43 |ile\n".#|define.C|
|000019d0| 48 41 4e 47 45 5f 49 4e | 46 4f 09 22 43 68 61 6e |HANGE_IN|FO."Chan|
|000019e0| 67 69 6e 67 20 74 68 65 | 20 61 67 69 6e 67 20 69 |ging the| aging i|
|000019f0| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 66 6f 72 20 25 |nformati|on for %|
|00001a00| 73 5c 6e 22 0a 23 64 65 | 66 69 6e 65 09 46 49 45 |s\n".#de|fine.FIE|
|00001a10| 4c 44 5f 45 52 52 09 22 | 25 73 3a 20 65 72 72 6f |LD_ERR."|%s: erro|
|00001a20| 72 20 63 68 61 6e 67 69 | 6e 67 20 66 69 65 6c 64 |r changi|ng field|
|00001a30| 73 5c 6e 22 0a 23 64 65 | 66 69 6e 65 09 4e 4f 5f |s\n".#de|fine.NO_|
|00001a40| 50 57 55 50 44 41 54 45 | 09 22 25 73 3a 20 63 61 |PWUPDATE|."%s: ca|
|00001a50| 6e 27 74 20 75 70 64 61 | 74 65 20 70 61 73 73 77 |n't upda|te passw|
|00001a60| 6f 72 64 20 66 69 6c 65 | 5c 6e 22 0a 23 64 65 66 |ord file|\n".#def|
|00001a70| 69 6e 65 09 4e 4f 5f 53 | 50 55 50 44 41 54 45 09 |ine.NO_S|PUPDATE.|
|00001a80| 22 25 73 3a 20 63 61 6e | 27 74 20 75 70 64 61 74 |"%s: can|'t updat|
|00001a90| 65 20 73 68 61 64 6f 77 | 20 70 61 73 73 77 6f 72 |e shadow| passwor|
|00001aa0| 64 20 66 69 6c 65 5c 6e | 22 0a 23 64 65 66 69 6e |d file\n|".#defin|
|00001ab0| 65 09 4e 4f 5f 50 57 43 | 4c 4f 53 45 09 22 25 73 |e.NO_PWC|LOSE."%s|
|00001ac0| 3a 20 63 61 6e 27 74 20 | 72 65 77 72 69 74 65 20 |: can't |rewrite |
|00001ad0| 70 61 73 73 77 6f 72 64 | 20 66 69 6c 65 5c 6e 22 |password| file\n"|
|00001ae0| 0a 23 64 65 66 69 6e 65 | 09 4e 4f 5f 53 50 43 4c |.#define|.NO_SPCL|
|00001af0| 4f 53 45 09 22 25 73 3a | 20 63 61 6e 27 74 20 72 |OSE."%s:| can't r|
|00001b00| 65 77 72 69 74 65 20 73 | 68 61 64 6f 77 20 70 61 |ewrite s|hadow pa|
|00001b10| 73 73 77 6f 72 64 20 66 | 69 6c 65 5c 6e 22 0a 23 |ssword f|ile\n".#|
|00001b20| 64 65 66 69 6e 65 09 4c | 4f 43 4b 5f 46 41 49 4c |define.L|OCK_FAIL|
|00001b30| 09 22 66 61 69 6c 65 64 | 20 6c 6f 63 6b 69 6e 67 |."failed| locking|
|00001b40| 20 25 73 5c 6e 22 0a 23 | 64 65 66 69 6e 65 09 4f | %s\n".#|define.O|
|00001b50| 50 45 4e 5f 46 41 49 4c | 09 22 66 61 69 6c 65 64 |PEN_FAIL|."failed|
|00001b60| 20 6f 70 65 6e 69 6e 67 | 20 25 73 5c 6e 22 0a 23 | opening| %s\n".#|
|00001b70| 64 65 66 69 6e 65 09 57 | 52 49 54 45 5f 46 41 49 |define.W|RITE_FAI|
|00001b80| 4c 09 22 66 61 69 6c 65 | 64 20 75 70 64 61 74 69 |L."faile|d updati|
|00001b90| 6e 67 20 25 73 5c 6e 22 | 0a 23 64 65 66 69 6e 65 |ng %s\n"|.#define|
|00001ba0| 09 43 4c 4f 53 45 5f 46 | 41 49 4c 09 22 66 61 69 |.CLOSE_F|AIL."fai|
|00001bb0| 6c 65 64 20 72 65 77 72 | 69 74 69 6e 67 20 25 73 |led rewr|iting %s|
|00001bc0| 5c 6e 22 0a 0a 2f 2a 0a | 20 2a 20 75 73 61 67 65 |\n"../*.| * usage|
|00001bd0| 20 2d 20 70 72 69 6e 74 | 20 63 6f 6d 6d 61 6e 64 | - print| command|
|00001be0| 20 6c 69 6e 65 20 73 79 | 6e 74 61 78 20 61 6e 64 | line sy|ntax and|
|00001bf0| 20 65 78 69 74 0a 20 2a | 2f 0a 0a 76 6f 69 64 0a | exit. *|/..void.|
|00001c00| 75 73 61 67 65 20 28 29 | 0a 7b 0a 09 66 70 72 69 |usage ()|.{..fpri|
|00001c10| 6e 74 66 20 28 73 74 64 | 65 72 72 2c 20 55 53 41 |ntf (std|err, USA|
|00001c20| 47 45 2c 20 50 72 6f 67 | 29 3b 0a 09 65 78 69 74 |GE, Prog|);..exit|
|00001c30| 20 28 31 29 3b 0a 7d 0a | 0a 2f 2a 0a 20 2a 20 73 | (1);.}.|./*. * s|
|00001c40| 74 72 74 6f 64 61 79 20 | 2d 20 63 6f 6d 70 75 74 |trtoday |- comput|
|00001c50| 65 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |e the nu|mber of |
|00001c60| 64 61 79 73 20 73 69 6e | 63 65 20 31 39 37 30 2e |days sin|ce 1970.|
|00001c70| 0a 20 2a 0a 20 2a 20 74 | 68 65 20 74 6f 74 61 6c |. *. * t|he total|
|00001c80| 20 6e 75 6d 62 65 72 20 | 6f 66 20 64 61 79 73 20 | number |of days |
|00001c90| 70 72 69 6f 72 20 74 6f | 20 74 68 65 20 63 75 72 |prior to| the cur|
|00001ca0| 72 65 6e 74 20 64 61 74 | 65 20 69 73 0a 20 2a 20 |rent dat|e is. * |
|00001cb0| 63 6f 6d 70 75 74 65 64 | 2e 20 20 6a 61 6e 75 61 |computed|. janua|
|00001cc0| 72 79 20 31 2c 20 31 39 | 37 30 20 69 73 20 75 73 |ry 1, 19|70 is us|
|00001cd0| 65 64 20 61 73 20 74 68 | 65 20 6f 72 69 67 69 6e |ed as th|e origin|
|00001ce0| 20 77 69 74 68 0a 20 2a | 20 69 74 20 68 61 76 69 | with. *| it havi|
|00001cf0| 6e 67 20 61 20 64 61 79 | 20 6e 75 6d 62 65 72 20 |ng a day| number |
|00001d00| 6f 66 20 30 2e 20 20 74 | 68 65 20 67 6d 74 69 6d |of 0. t|he gmtim|
|00001d10| 65 28 29 20 72 6f 75 74 | 69 6e 65 20 69 73 0a 20 |e() rout|ine is. |
|00001d20| 2a 20 75 73 65 64 20 74 | 6f 20 70 72 65 76 65 6e |* used t|o preven|
|00001d30| 74 20 63 6f 6e 66 75 73 | 69 6f 6e 20 72 65 67 61 |t confus|ion rega|
|00001d40| 72 64 69 6e 67 20 74 69 | 6d 65 20 7a 6f 6e 65 73 |rding ti|me zones|
|00001d50| 2e 0a 20 2a 2f 0a 0a 6c | 6f 6e 67 0a 73 74 72 74 |.. */..l|ong.strt|
|00001d60| 6f 64 61 79 20 28 73 74 | 72 29 0a 63 68 61 72 09 |oday (st|r).char.|
|00001d70| 2a 73 74 72 3b 0a 7b 0a | 09 63 68 61 72 09 73 6c |*str;.{.|.char.sl|
|00001d80| 6f 70 5b 32 5d 3b 0a 09 | 69 6e 74 09 6d 6f 6e 74 |op[2];..|int.mont|
|00001d90| 68 3b 0a 09 69 6e 74 09 | 64 61 79 3b 0a 09 69 6e |h;..int.|day;..in|
|00001da0| 74 09 79 65 61 72 3b 0a | 09 6c 6f 6e 67 09 74 6f |t.year;.|.long.to|
|00001db0| 74 61 6c 3b 0a 0a 09 2f | 2a 0a 09 20 2a 20 73 74 |tal;.../|*.. * st|
|00001dc0| 61 72 74 20 62 79 20 73 | 65 70 61 72 61 74 69 6e |art by s|eparatin|
|00001dd0| 67 20 74 68 65 20 6d 6f | 6e 74 68 2c 20 64 61 79 |g the mo|nth, day|
|00001de0| 20 61 6e 64 20 79 65 61 | 72 2e 20 20 74 68 69 73 | and yea|r. this|
|00001df0| 20 69 73 0a 09 20 2a 20 | 61 20 63 68 61 75 76 61 | is.. * |a chauva|
|00001e00| 6e 69 73 74 69 63 20 70 | 72 6f 67 72 61 6d 20 2d |nistic p|rogram -|
|00001e10| 20 69 74 20 6f 6e 6c 79 | 20 74 61 6b 65 73 20 64 | it only| takes d|
|00001e20| 61 74 65 20 69 6e 70 75 | 74 20 69 6e 0a 09 20 2a |ate inpu|t in.. *|
|00001e30| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 55 53 | the sta|ndard US|
|00001e40| 41 20 66 6f 72 6d 61 74 | 2e 0a 09 20 2a 2f 0a 0a |A format|... */..|
|00001e50| 09 69 66 20 28 73 73 63 | 61 6e 66 20 28 73 74 72 |.if (ssc|anf (str|
|00001e60| 2c 20 22 25 64 2f 25 64 | 2f 25 64 25 63 22 2c 20 |, "%d/%d|/%d%c", |
|00001e70| 26 6d 6f 6e 74 68 2c 20 | 26 64 61 79 2c 20 26 79 |&month, |&day, &y|
|00001e80| 65 61 72 2c 20 73 6c 6f | 70 29 20 21 3d 20 33 29 |ear, slo|p) != 3)|
|00001e90| 0a 09 09 72 65 74 75 72 | 6e 20 2d 31 3b 0a 0a 09 |...retur|n -1;...|
|00001ea0| 2f 2a 0a 09 20 2a 20 74 | 68 65 20 6d 6f 6e 74 68 |/*.. * t|he month|
|00001eb0| 2c 20 64 61 79 20 6f 66 | 20 74 68 65 20 6d 6f 6e |, day of| the mon|
|00001ec0| 74 68 2c 20 61 6e 64 20 | 79 65 61 72 20 61 72 65 |th, and |year are|
|00001ed0| 20 63 68 65 63 6b 65 64 | 20 66 6f 72 0a 09 20 2a | checked| for.. *|
|00001ee0| 20 63 6f 72 72 65 63 74 | 6e 65 73 73 20 61 6e 64 | correct|ness and|
|00001ef0| 20 74 68 65 20 79 65 61 | 72 20 61 64 6a 75 73 74 | the yea|r adjust|
|00001f00| 65 64 20 73 6f 20 69 74 | 20 66 61 6c 6c 73 20 62 |ed so it| falls b|
|00001f10| 65 74 77 65 65 6e 0a 09 | 20 2a 20 31 39 37 30 20 |etween..| * 1970 |
|00001f20| 61 6e 64 20 32 30 36 39 | 2e 0a 09 20 2a 2f 0a 0a |and 2069|... */..|
|00001f30| 09 69 66 20 28 6d 6f 6e | 74 68 20 3c 20 31 20 7c |.if (mon|th < 1 ||
|00001f40| 7c 20 6d 6f 6e 74 68 20 | 3e 20 31 32 29 0a 09 09 || month |> 12)...|
|00001f50| 72 65 74 75 72 6e 20 2d | 31 3b 0a 0a 09 69 66 20 |return -|1;...if |
|00001f60| 28 64 61 79 20 3c 20 31 | 29 0a 09 09 72 65 74 75 |(day < 1|)...retu|
|00001f70| 72 6e 20 2d 31 3b 0a 0a | 09 69 66 20 28 28 6d 6f |rn -1;..|.if ((mo|
|00001f80| 6e 74 68 20 21 3d 20 32 | 20 7c 7c 20 28 79 65 61 |nth != 2| || (yea|
|00001f90| 72 20 25 20 34 29 20 21 | 3d 20 30 29 20 26 26 20 |r % 4) !|= 0) && |
|00001fa0| 64 61 79 20 3e 20 64 61 | 79 73 5b 6d 6f 6e 74 68 |day > da|ys[month|
|00001fb0| 5d 29 0a 09 09 72 65 74 | 75 72 6e 20 2d 31 3b 0a |])...ret|urn -1;.|
|00001fc0| 09 65 6c 73 65 20 69 66 | 20 28 28 6d 6f 6e 74 68 |.else if| ((month|
|00001fd0| 20 3d 3d 20 32 20 26 26 | 20 28 79 65 61 72 20 25 | == 2 &&| (year %|
|00001fe0| 20 34 29 20 3d 3d 20 30 | 29 20 26 26 20 64 61 79 | 4) == 0|) && day|
|00001ff0| 20 3e 20 32 39 29 0a 09 | 09 72 65 74 75 72 6e 20 | > 29)..|.return |
|00002000| 2d 31 3b 0a 0a 09 69 66 | 20 28 79 65 61 72 20 3c |-1;...if| (year <|
|00002010| 20 30 29 0a 09 09 72 65 | 74 75 72 6e 20 2d 31 3b | 0)...re|turn -1;|
|00002020| 0a 09 65 6c 73 65 20 69 | 66 20 28 79 65 61 72 20 |..else i|f (year |
|00002030| 3c 20 36 39 29 0a 09 09 | 79 65 61 72 20 2b 3d 20 |< 69)...|year += |
|00002040| 32 30 30 30 3b 0a 09 65 | 6c 73 65 20 69 66 20 28 |2000;..e|lse if (|
|00002050| 79 65 61 72 20 3c 20 39 | 39 29 0a 09 09 79 65 61 |year < 9|9)...yea|
|00002060| 72 20 2b 3d 20 31 39 30 | 30 3b 0a 0a 09 69 66 20 |r += 190|0;...if |
|00002070| 28 79 65 61 72 20 3c 20 | 31 39 37 30 20 7c 7c 20 |(year < |1970 || |
|00002080| 79 65 61 72 20 3e 20 32 | 30 36 39 29 0a 09 09 72 |year > 2|069)...r|
|00002090| 65 74 75 72 6e 20 2d 31 | 3b 0a 0a 09 2f 2a 0a 09 |eturn -1|;.../*..|
|000020a0| 20 2a 20 74 68 65 20 74 | 6f 74 61 6c 20 6e 75 6d | * the t|otal num|
|000020b0| 62 65 72 20 6f 66 20 64 | 61 79 73 20 69 73 20 74 |ber of d|ays is t|
|000020c0| 68 65 20 74 6f 74 61 6c | 20 6e 75 6d 62 65 72 20 |he total| number |
|000020d0| 6f 66 20 64 61 79 73 20 | 69 6e 20 61 6c 6c 0a 09 |of days |in all..|
|000020e0| 20 2a 20 74 68 65 20 77 | 68 6f 6c 65 20 79 65 61 | * the w|hole yea|
|000020f0| 72 73 2c 20 70 6c 75 73 | 20 74 68 65 20 6e 75 6d |rs, plus| the num|
|00002100| 62 65 72 20 6f 66 20 6c | 65 61 70 20 64 61 79 73 |ber of l|eap days|
|00002110| 2c 20 70 6c 75 73 20 74 | 68 65 0a 09 20 2a 20 6e |, plus t|he.. * n|
|00002120| 75 6d 62 65 72 20 6f 66 | 20 64 61 79 73 20 69 6e |umber of| days in|
|00002130| 20 74 68 65 20 77 68 6f | 6c 65 20 6d 6f 6e 74 68 | the who|le month|
|00002140| 73 20 70 72 65 63 65 64 | 69 6e 67 2c 20 70 6c 75 |s preced|ing, plu|
|00002150| 73 20 74 68 65 20 6e 75 | 6d 62 65 72 0a 09 20 2a |s the nu|mber.. *|
|00002160| 20 6f 66 20 64 61 79 73 | 20 73 6f 20 66 61 72 20 | of days| so far |
|00002170| 69 6e 20 74 68 65 20 6d | 6f 6e 74 68 2e 0a 09 20 |in the m|onth... |
|00002180| 2a 2f 0a 0a 09 74 6f 74 | 61 6c 20 3d 20 28 28 79 |*/...tot|al = ((y|
|00002190| 65 61 72 20 2d 20 31 39 | 37 30 29 20 2a 20 33 36 |ear - 19|70) * 36|
|000021a0| 35 29 20 2b 20 28 28 28 | 79 65 61 72 20 2b 20 31 |5) + (((|year + 1|
|000021b0| 29 20 2d 20 31 39 37 30 | 29 20 2f 20 34 29 3b 0a |) - 1970|) / 4);.|
|000021c0| 09 74 6f 74 61 6c 20 2b | 3d 20 6a 75 6c 64 61 79 |.total +|= julday|
|000021d0| 73 5b 6d 6f 6e 74 68 5d | 20 2b 20 28 6d 6f 6e 74 |s[month]| + (mont|
|000021e0| 68 20 3e 20 32 20 26 26 | 20 28 79 65 61 72 20 25 |h > 2 &&| (year %|
|000021f0| 20 34 29 20 3d 3d 20 30 | 20 3f 20 31 3a 30 29 3b | 4) == 0| ? 1:0);|
|00002200| 0a 09 74 6f 74 61 6c 20 | 2b 3d 20 64 61 79 20 2d |..total |+= day -|
|00002210| 20 31 3b 0a 0a 09 72 65 | 74 75 72 6e 20 74 6f 74 | 1;...re|turn tot|
|00002220| 61 6c 3b 0a 7d 0a 0a 2f | 2a 0a 20 2a 20 6e 65 77 |al;.}../|*. * new|
|00002230| 5f 66 69 65 6c 64 73 20 | 2d 20 63 68 61 6e 67 65 |_fields |- change|
|00002240| 20 74 68 65 20 75 73 65 | 72 27 73 20 70 61 73 73 | the use|r's pass|
|00002250| 77 6f 72 64 20 61 67 69 | 6e 67 20 69 6e 66 6f 72 |word agi|ng infor|
|00002260| 6d 61 74 69 6f 6e 20 69 | 6e 74 65 72 61 63 74 69 |mation i|nteracti|
|00002270| 76 65 6c 79 2e 0a 20 2a | 0a 20 2a 20 70 72 6f 6d |vely.. *|. * prom|
|00002280| 70 74 20 74 68 65 20 75 | 73 65 72 20 66 6f 72 20 |pt the u|ser for |
|00002290| 61 6c 6c 20 6f 66 20 74 | 68 65 20 70 61 73 73 77 |all of t|he passw|
|000022a0| 6f 72 64 20 61 67 65 20 | 76 61 6c 75 65 73 2e 20 |ord age |values. |
|000022b0| 20 73 65 74 20 74 68 65 | 20 66 69 65 6c 64 73 0a | set the| fields.|
|000022c0| 20 2a 20 66 72 6f 6d 20 | 74 68 65 20 75 73 65 72 | * from |the user|
|000022d0| 27 73 20 72 65 73 70 6f | 6e 73 65 2c 20 6f 72 20 |'s respo|nse, or |
|000022e0| 6c 65 61 76 65 20 61 6c | 6f 6e 65 20 69 66 20 6e |leave al|one if n|
|000022f0| 6f 74 68 69 6e 67 20 77 | 61 73 20 65 6e 74 65 72 |othing w|as enter|
|00002300| 65 64 2e 20 20 74 68 65 | 0a 20 2a 20 76 61 6c 75 |ed. the|. * valu|
|00002310| 65 20 28 2d 31 29 20 69 | 73 20 75 73 65 64 20 74 |e (-1) i|s used t|
|00002320| 6f 20 69 6e 64 69 63 61 | 74 65 20 74 68 65 20 66 |o indica|te the f|
|00002330| 69 65 6c 64 20 73 68 6f | 75 6c 64 20 62 65 20 72 |ield sho|uld be r|
|00002340| 65 6d 6f 76 65 64 20 69 | 66 20 70 6f 73 73 69 62 |emoved i|f possib|
|00002350| 6c 65 2e 0a 20 2a 20 61 | 6e 79 20 6f 74 68 65 72 |le.. * a|ny other|
|00002360| 20 6e 65 67 61 74 69 76 | 65 20 76 61 6c 75 65 20 | negativ|e value |
|00002370| 69 73 20 61 6e 20 65 72 | 72 6f 72 2e 20 20 76 65 |is an er|ror. ve|
|00002380| 72 79 20 6c 61 72 67 65 | 20 70 6f 73 69 74 69 76 |ry large| positiv|
|00002390| 65 20 76 61 6c 75 65 73 | 20 77 69 6c 6c 0a 20 2a |e values| will. *|
|000023a0| 20 62 65 20 68 61 6e 64 | 6c 65 64 20 65 6c 73 65 | be hand|led else|
|000023b0| 77 68 65 72 65 2e 0a 20 | 2a 2f 0a 0a 69 6e 74 0a |where.. |*/..int.|
|000023c0| 6e 65 77 5f 66 69 65 6c | 64 73 20 28 29 0a 7b 0a |new_fiel|ds ().{.|
|000023d0| 09 63 68 61 72 09 62 75 | 66 5b 42 55 46 53 49 5a |.char.bu|f[BUFSIZ|
|000023e0| 5d 3b 0a 09 63 68 61 72 | 09 2a 63 70 3b 0a 09 6c |];..char|.*cp;..l|
|000023f0| 6f 6e 67 09 76 61 6c 75 | 65 3b 0a 09 73 74 72 75 |ong.valu|e;..stru|
|00002400| 63 74 09 74 6d 09 2a 74 | 70 3b 0a 0a 09 70 72 69 |ct.tm.*t|p;...pri|
|00002410| 6e 74 66 20 28 22 45 6e | 74 65 72 20 74 68 65 20 |ntf ("En|ter the |
|00002420| 6e 65 77 20 76 61 6c 75 | 65 2c 20 6f 72 20 70 72 |new valu|e, or pr|
|00002430| 65 73 73 20 72 65 74 75 | 72 6e 20 66 6f 72 20 74 |ess retu|rn for t|
|00002440| 68 65 20 64 65 66 61 75 | 6c 74 5c 6e 5c 6e 22 29 |he defau|lt\n\n")|
|00002450| 3b 0a 0a 09 73 70 72 69 | 6e 74 66 20 28 62 75 66 |;...spri|ntf (buf|
|00002460| 2c 20 22 25 6c 64 22 2c | 20 6d 69 6e 64 61 79 73 |, "%ld",| mindays|
|00002470| 29 3b 0a 09 63 68 61 6e | 67 65 5f 66 69 65 6c 64 |);..chan|ge_field|
|00002480| 20 28 62 75 66 2c 20 22 | 4d 69 6e 69 6d 75 6d 20 | (buf, "|Minimum |
|00002490| 50 61 73 73 77 6f 72 64 | 20 41 67 65 22 29 3b 0a |Password| Age");.|
|000024a0| 09 69 66 20 28 28 28 6d | 69 6e 64 61 79 73 20 3d |.if (((m|indays =|
|000024b0| 20 73 74 72 74 6f 6c 20 | 28 62 75 66 2c 20 26 63 | strtol |(buf, &c|
|000024c0| 70 2c 20 31 30 29 29 20 | 3d 3d 20 30 20 26 26 20 |p, 10)) |== 0 && |
|000024d0| 2a 63 70 29 20 7c 7c 20 | 6d 69 6e 64 61 79 73 20 |*cp) || |mindays |
|000024e0| 3c 20 2d 31 29 0a 09 09 | 72 65 74 75 72 6e 20 30 |< -1)...|return 0|
|000024f0| 3b 0a 0a 09 73 70 72 69 | 6e 74 66 20 28 62 75 66 |;...spri|ntf (buf|
|00002500| 2c 20 22 25 6c 64 22 2c | 20 6d 61 78 64 61 79 73 |, "%ld",| maxdays|
|00002510| 29 3b 0a 09 63 68 61 6e | 67 65 5f 66 69 65 6c 64 |);..chan|ge_field|
|00002520| 20 28 62 75 66 2c 20 22 | 4d 61 78 69 6d 75 6d 20 | (buf, "|Maximum |
|00002530| 50 61 73 73 77 6f 72 64 | 20 41 67 65 22 29 3b 0a |Password| Age");.|
|00002540| 09 69 66 20 28 28 28 6d | 61 78 64 61 79 73 20 3d |.if (((m|axdays =|
|00002550| 20 73 74 72 74 6f 6c 20 | 28 62 75 66 2c 20 26 63 | strtol |(buf, &c|
|00002560| 70 2c 20 31 30 29 29 20 | 3d 3d 20 30 20 26 26 20 |p, 10)) |== 0 && |
|00002570| 2a 63 70 29 20 7c 7c 20 | 6d 61 78 64 61 79 73 20 |*cp) || |maxdays |
|00002580| 3c 20 2d 31 29 0a 09 09 | 72 65 74 75 72 6e 20 30 |< -1)...|return 0|
|00002590| 3b 0a 0a 09 76 61 6c 75 | 65 20 3d 20 6c 61 73 74 |;...valu|e = last|
|000025a0| 64 61 79 20 2a 20 53 43 | 41 4c 45 3b 0a 09 74 70 |day * SC|ALE;..tp|
|000025b0| 20 3d 20 67 6d 74 69 6d | 65 20 28 26 76 61 6c 75 | = gmtim|e (&valu|
|000025c0| 65 29 3b 0a 09 73 70 72 | 69 6e 74 66 20 28 62 75 |e);..spr|intf (bu|
|000025d0| 66 2c 20 22 25 30 32 64 | 2f 25 30 32 64 2f 25 30 |f, "%02d|/%02d/%0|
|000025e0| 32 64 22 2c 0a 09 09 74 | 70 2d 3e 74 6d 5f 6d 6f |2d",...t|p->tm_mo|
|000025f0| 6e 20 2b 20 31 2c 20 74 | 70 2d 3e 74 6d 5f 6d 64 |n + 1, t|p->tm_md|
|00002600| 61 79 2c 20 74 70 2d 3e | 74 6d 5f 79 65 61 72 29 |ay, tp->|tm_year)|
|00002610| 3b 0a 09 63 68 61 6e 67 | 65 5f 66 69 65 6c 64 20 |;..chang|e_field |
|00002620| 28 62 75 66 2c 20 22 4c | 61 73 74 20 50 61 73 73 |(buf, "L|ast Pass|
|00002630| 77 6f 72 64 20 43 68 61 | 6e 67 65 20 28 4d 4d 2f |word Cha|nge (MM/|
|00002640| 44 44 2f 59 59 29 22 29 | 3b 0a 09 69 66 20 28 73 |DD/YY)")|;..if (s|
|00002650| 74 72 63 6d 70 20 28 62 | 75 66 2c 20 22 31 32 2f |trcmp (b|uf, "12/|
|00002660| 33 31 2f 36 39 22 29 20 | 3d 3d 20 30 29 0a 09 09 |31/69") |== 0)...|
|00002670| 6c 61 73 74 64 61 79 20 | 3d 20 2d 31 3b 0a 09 65 |lastday |= -1;..e|
|00002680| 6c 73 65 20 69 66 20 28 | 28 6c 61 73 74 64 61 79 |lse if (|(lastday|
|00002690| 20 3d 20 73 74 72 74 6f | 64 61 79 20 28 62 75 66 | = strto|day (buf|
|000026a0| 29 29 20 3d 3d 20 2d 31 | 29 0a 09 09 72 65 74 75 |)) == -1|)...retu|
|000026b0| 72 6e 20 30 3b 0a 0a 09 | 73 70 72 69 6e 74 66 20 |rn 0;...|sprintf |
|000026c0| 28 62 75 66 2c 20 22 25 | 6c 64 22 2c 20 77 61 72 |(buf, "%|ld", war|
|000026d0| 6e 64 61 79 73 29 3b 0a | 09 63 68 61 6e 67 65 5f |ndays);.|.change_|
|000026e0| 66 69 65 6c 64 20 28 62 | 75 66 2c 20 22 50 61 73 |field (b|uf, "Pas|
|000026f0| 73 77 6f 72 64 20 45 78 | 70 69 72 61 74 69 6f 6e |sword Ex|piration|
|00002700| 20 57 61 72 6e 69 6e 67 | 22 29 3b 0a 09 69 66 20 | Warning|");..if |
|00002710| 28 28 28 77 61 72 6e 64 | 61 79 73 20 3d 20 73 74 |(((warnd|ays = st|
|00002720| 72 74 6f 6c 20 28 62 75 | 66 2c 20 26 63 70 2c 20 |rtol (bu|f, &cp, |
|00002730| 31 30 29 29 20 3d 3d 20 | 30 20 26 26 20 2a 63 70 |10)) == |0 && *cp|
|00002740| 29 20 7c 7c 20 77 61 72 | 6e 64 61 79 73 20 3c 20 |) || war|ndays < |
|00002750| 2d 31 29 0a 09 09 72 65 | 74 75 72 6e 20 30 3b 0a |-1)...re|turn 0;.|
|00002760| 0a 09 73 70 72 69 6e 74 | 66 20 28 62 75 66 2c 20 |..sprint|f (buf, |
|00002770| 22 25 6c 64 22 2c 20 69 | 6e 61 63 74 64 61 79 73 |"%ld", i|nactdays|
|00002780| 29 3b 0a 09 63 68 61 6e | 67 65 5f 66 69 65 6c 64 |);..chan|ge_field|
|00002790| 20 28 62 75 66 2c 20 22 | 50 61 73 73 77 6f 72 64 | (buf, "|Password|
|000027a0| 20 49 6e 61 63 74 69 76 | 65 22 29 3b 0a 09 69 66 | Inactiv|e");..if|
|000027b0| 20 28 28 28 69 6e 61 63 | 74 64 61 79 73 20 3d 20 | (((inac|tdays = |
|000027c0| 73 74 72 74 6f 6c 20 28 | 62 75 66 2c 20 26 63 70 |strtol (|buf, &cp|
|000027d0| 2c 20 31 30 29 29 20 3d | 3d 20 30 20 26 26 20 2a |, 10)) =|= 0 && *|
|000027e0| 63 70 29 20 7c 7c 20 69 | 6e 61 63 74 64 61 79 73 |cp) || i|nactdays|
|000027f0| 20 3c 20 2d 31 29 0a 09 | 09 72 65 74 75 72 6e 20 | < -1)..|.return |
|00002800| 30 3b 0a 0a 09 76 61 6c | 75 65 20 3d 20 65 78 70 |0;...val|ue = exp|
|00002810| 64 61 79 73 20 2a 20 53 | 43 41 4c 45 3b 0a 09 74 |days * S|CALE;..t|
|00002820| 70 20 3d 20 67 6d 74 69 | 6d 65 20 28 26 76 61 6c |p = gmti|me (&val|
|00002830| 75 65 29 3b 0a 09 73 70 | 72 69 6e 74 66 20 28 62 |ue);..sp|rintf (b|
|00002840| 75 66 2c 20 22 25 30 32 | 64 2f 25 30 32 64 2f 25 |uf, "%02|d/%02d/%|
|00002850| 30 32 64 22 2c 0a 09 09 | 74 70 2d 3e 74 6d 5f 6d |02d",...|tp->tm_m|
|00002860| 6f 6e 20 2b 20 31 2c 20 | 74 70 2d 3e 74 6d 5f 6d |on + 1, |tp->tm_m|
|00002870| 64 61 79 2c 20 74 70 2d | 3e 74 6d 5f 79 65 61 72 |day, tp-|>tm_year|
|00002880| 29 3b 0a 09 63 68 61 6e | 67 65 5f 66 69 65 6c 64 |);..chan|ge_field|
|00002890| 20 28 62 75 66 2c 20 22 | 41 63 63 6f 75 6e 74 20 | (buf, "|Account |
|000028a0| 45 78 70 69 72 61 74 69 | 6f 6e 20 44 61 74 65 20 |Expirati|on Date |
|000028b0| 28 4d 4d 2f 44 44 2f 59 | 59 29 22 29 3b 0a 09 69 |(MM/DD/Y|Y)");..i|
|000028c0| 66 20 28 73 74 72 63 6d | 70 20 28 62 75 66 2c 20 |f (strcm|p (buf, |
|000028d0| 22 31 32 2f 33 31 2f 36 | 39 22 29 20 3d 3d 20 30 |"12/31/6|9") == 0|
|000028e0| 29 0a 09 09 65 78 70 64 | 61 79 73 20 3d 20 2d 31 |)...expd|ays = -1|
|000028f0| 3b 0a 09 65 6c 73 65 20 | 69 66 20 28 28 65 78 70 |;..else |if ((exp|
|00002900| 64 61 79 73 20 3d 20 73 | 74 72 74 6f 64 61 79 20 |days = s|trtoday |
|00002910| 28 62 75 66 29 29 20 3d | 3d 20 2d 31 29 0a 09 09 |(buf)) =|= -1)...|
|00002920| 72 65 74 75 72 6e 20 30 | 3b 0a 0a 09 72 65 74 75 |return 0|;...retu|
|00002930| 72 6e 20 31 3b 0a 7d 0a | 0a 2f 2a 0a 20 2a 20 6c |rn 1;.}.|./*. * l|
|00002940| 69 73 74 5f 66 69 65 6c | 64 73 20 2d 20 64 69 73 |ist_fiel|ds - dis|
|00002950| 70 6c 61 79 20 74 68 65 | 20 63 75 72 72 65 6e 74 |play the| current|
|00002960| 20 76 61 6c 75 65 73 20 | 6f 66 20 74 68 65 20 65 | values |of the e|
|00002970| 78 70 69 72 61 74 69 6f | 6e 20 66 69 65 6c 64 73 |xpiratio|n fields|
|00002980| 0a 20 2a 0a 20 2a 20 64 | 69 73 70 6c 61 79 20 74 |. *. * d|isplay t|
|00002990| 68 65 20 70 61 73 73 77 | 6f 72 64 20 61 67 65 20 |he passw|ord age |
|000029a0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 66 72 6f 6d |informat|ion from|
|000029b0| 20 74 68 65 20 70 61 73 | 73 77 6f 72 64 20 66 69 | the pas|sword fi|
|000029c0| 65 6c 64 73 2e 20 20 64 | 61 74 65 0a 20 2a 20 76 |elds. d|ate. * v|
|000029d0| 61 6c 75 65 73 20 77 69 | 6c 6c 20 62 65 20 64 69 |alues wi|ll be di|
|000029e0| 73 70 6c 61 79 65 64 20 | 61 73 20 61 20 63 61 6c |splayed |as a cal|
|000029f0| 65 6e 64 61 72 20 64 61 | 74 65 2c 20 6f 72 20 74 |endar da|te, or t|
|00002a00| 68 65 20 77 6f 72 64 20 | 22 4e 65 76 65 72 22 20 |he word |"Never" |
|00002a10| 69 66 0a 20 2a 20 74 68 | 65 20 64 61 74 65 20 69 |if. * th|e date i|
|00002a20| 73 20 31 2f 31 2f 37 30 | 2c 20 77 68 69 63 68 20 |s 1/1/70|, which |
|00002a30| 69 73 20 64 61 79 20 6e | 75 6d 62 65 72 20 30 2e |is day n|umber 0.|
|00002a40| 0a 20 2a 2f 0a 0a 76 6f | 69 64 0a 6c 69 73 74 5f |. */..vo|id.list_|
|00002a50| 66 69 65 6c 64 73 20 28 | 29 0a 7b 0a 09 73 74 72 |fields (|).{..str|
|00002a60| 75 63 74 09 74 6d 09 2a | 74 70 3b 0a 09 63 68 61 |uct.tm.*|tp;..cha|
|00002a70| 72 09 2a 63 70 3b 0a 09 | 6c 6f 6e 67 09 63 68 61 |r.*cp;..|long.cha|
|00002a80| 6e 67 65 64 3b 0a 09 6c | 6f 6e 67 09 65 78 70 69 |nged;..l|ong.expi|
|00002a90| 72 65 73 3b 0a 0a 09 2f | 2a 0a 09 20 2a 20 53 74 |res;.../|*.. * St|
|00002aa0| 61 72 74 20 77 69 74 68 | 20 74 68 65 20 65 61 73 |art with| the eas|
|00002ab0| 79 20 6e 75 6d 62 65 72 | 73 20 2d 20 74 68 65 20 |y number|s - the |
|00002ac0| 6e 75 6d 62 65 72 20 6f | 66 20 64 61 79 73 20 62 |number o|f days b|
|00002ad0| 65 66 6f 72 65 20 74 68 | 65 0a 09 20 2a 20 70 61 |efore th|e.. * pa|
|00002ae0| 73 73 77 6f 72 64 20 63 | 61 6e 20 62 65 20 63 68 |ssword c|an be ch|
|00002af0| 61 6e 67 65 64 2c 20 74 | 68 65 20 6e 75 6d 62 65 |anged, t|he numbe|
|00002b00| 72 20 6f 66 20 64 61 79 | 73 20 61 66 74 65 72 20 |r of day|s after |
|00002b10| 77 68 69 63 68 20 74 68 | 65 0a 09 20 2a 20 70 61 |which th|e.. * pa|
|00002b20| 73 73 77 6f 72 64 20 6d | 75 73 74 20 62 65 20 63 |ssword m|ust be c|
|00002b30| 68 61 67 65 64 2c 20 74 | 68 65 20 6e 75 6d 62 65 |haged, t|he numbe|
|00002b40| 72 20 6f 66 20 64 61 79 | 73 20 62 65 66 6f 72 65 |r of day|s before|
|00002b50| 20 74 68 65 0a 09 20 2a | 20 70 61 73 73 77 6f 72 | the.. *| passwor|
|00002b60| 64 20 65 78 70 69 72 65 | 73 20 74 68 61 74 20 74 |d expire|s that t|
|00002b70| 68 65 20 75 73 65 72 20 | 69 73 20 74 6f 6c 64 2c |he user |is told,|
|00002b80| 20 61 6e 64 20 74 68 65 | 20 6e 75 6d 62 65 72 20 | and the| number |
|00002b90| 6f 66 0a 09 20 2a 20 64 | 61 79 73 20 61 66 74 65 |of.. * d|ays afte|
|00002ba0| 72 20 74 68 65 20 70 61 | 73 73 77 6f 72 64 20 65 |r the pa|ssword e|
|00002bb0| 78 70 69 72 65 73 20 74 | 68 61 74 20 74 68 65 20 |xpires t|hat the |
|00002bc0| 61 63 63 6f 75 6e 74 20 | 62 65 63 6f 6d 65 73 0a |account |becomes.|
|00002bd0| 09 20 2a 20 75 6e 75 73 | 61 62 6c 65 2e 0a 09 20 |. * unus|able... |
|00002be0| 2a 2f 0a 0a 09 70 72 69 | 6e 74 66 20 28 22 4d 69 |*/...pri|ntf ("Mi|
|00002bf0| 6e 69 6d 75 6d 3a 5c 74 | 25 64 5c 6e 22 2c 20 6d |nimum:\t|%d\n", m|
|00002c00| 69 6e 64 61 79 73 29 3b | 0a 09 70 72 69 6e 74 66 |indays);|..printf|
|00002c10| 20 28 22 4d 61 78 69 6d | 75 6d 3a 5c 74 25 64 5c | ("Maxim|um:\t%d\|
|00002c20| 6e 22 2c 20 6d 61 78 64 | 61 79 73 29 3b 0a 09 70 |n", maxd|ays);..p|
|00002c30| 72 69 6e 74 66 20 28 22 | 57 61 72 6e 69 6e 67 3a |rintf ("|Warning:|
|00002c40| 5c 74 25 64 5c 6e 22 2c | 20 77 61 72 6e 64 61 79 |\t%d\n",| warnday|
|00002c50| 73 29 3b 0a 09 70 72 69 | 6e 74 66 20 28 22 49 6e |s);..pri|ntf ("In|
|00002c60| 61 63 74 69 76 65 3a 5c | 74 25 64 5c 6e 22 2c 20 |active:\|t%d\n", |
|00002c70| 69 6e 61 63 74 64 61 79 | 73 29 3b 0a 0a 09 2f 2a |inactday|s);.../*|
|00002c80| 0a 09 20 2a 20 54 68 65 | 20 22 6c 61 73 74 20 63 |.. * The| "last c|
|00002c90| 68 61 6e 67 65 22 20 64 | 61 74 65 20 69 73 20 65 |hange" d|ate is e|
|00002ca0| 69 74 68 65 72 20 22 4e | 65 76 65 72 22 20 6f 72 |ither "N|ever" or|
|00002cb0| 20 74 68 65 20 64 61 74 | 65 20 74 68 65 0a 09 20 | the dat|e the.. |
|00002cc0| 2a 20 70 61 73 73 77 6f | 72 64 20 77 61 73 20 6c |* passwo|rd was l|
|00002cd0| 61 73 74 20 6d 6f 64 69 | 66 69 65 64 2e 20 20 54 |ast modi|fied. T|
|00002ce0| 68 65 20 64 61 74 65 20 | 69 73 20 74 68 65 20 6e |he date |is the n|
|00002cf0| 75 6d 62 65 72 20 6f 66 | 0a 09 20 2a 20 64 61 79 |umber of|.. * day|
|00002d00| 73 20 73 69 6e 63 65 20 | 31 2f 31 2f 31 39 37 30 |s since |1/1/1970|
|00002d10| 2e 0a 09 20 2a 2f 0a 0a | 09 70 72 69 6e 74 66 20 |... */..|.printf |
|00002d20| 28 22 4c 61 73 74 20 43 | 68 61 6e 67 65 3a 5c 74 |("Last C|hange:\t|
|00002d30| 5c 74 22 29 3b 0a 09 69 | 66 20 28 6c 61 73 74 64 |\t");..i|f (lastd|
|00002d40| 61 79 20 3c 3d 20 30 29 | 20 7b 0a 09 09 70 72 69 |ay <= 0)| {...pri|
|00002d50| 6e 74 66 20 28 22 4e 65 | 76 65 72 5c 6e 22 29 3b |ntf ("Ne|ver\n");|
|00002d60| 0a 09 7d 20 65 6c 73 65 | 20 7b 0a 09 09 63 68 61 |..} else| {...cha|
|00002d70| 6e 67 65 64 20 3d 20 6c | 61 73 74 64 61 79 20 2a |nged = l|astday *|
|00002d80| 20 53 43 41 4c 45 3b 0a | 09 09 74 70 20 3d 20 67 | SCALE;.|..tp = g|
|00002d90| 6d 74 69 6d 65 20 28 26 | 63 68 61 6e 67 65 64 29 |mtime (&|changed)|
|00002da0| 3b 0a 09 09 63 70 20 3d | 20 61 73 63 74 69 6d 65 |;...cp =| asctime|
|00002db0| 20 28 74 70 29 3b 0a 09 | 09 70 72 69 6e 74 66 20 | (tp);..|.printf |
|00002dc0| 28 22 25 36 2e 36 73 2c | 20 25 34 2e 34 73 5c 6e |("%6.6s,| %4.4s\n|
|00002dd0| 22 2c 20 63 70 20 2b 20 | 34 2c 20 63 70 20 2b 20 |", cp + |4, cp + |
|00002de0| 32 30 29 3b 0a 09 7d 0a | 0a 09 2f 2a 0a 09 20 2a |20);..}.|../*.. *|
|00002df0| 20 54 68 65 20 70 61 73 | 73 77 6f 72 64 20 65 78 | The pas|sword ex|
|00002e00| 70 69 72 61 74 69 6f 6e | 20 64 61 74 65 20 69 73 |piration| date is|
|00002e10| 20 64 65 74 65 72 6d 69 | 6e 65 64 20 66 72 6f 6d | determi|ned from|
|00002e20| 20 74 68 65 20 6c 61 73 | 74 0a 09 20 2a 20 63 68 | the las|t.. * ch|
|00002e30| 61 6e 67 65 20 64 61 74 | 65 20 70 6c 75 73 20 74 |ange dat|e plus t|
|00002e40| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 64 61 79 |he numbe|r of day|
|00002e50| 73 20 74 68 65 20 70 61 | 73 73 77 6f 72 64 20 69 |s the pa|ssword i|
|00002e60| 73 20 76 61 6c 69 64 0a | 09 20 2a 20 66 6f 72 2e |s valid.|. * for.|
|00002e70| 0a 09 20 2a 2f 0a 0a 09 | 70 72 69 6e 74 66 20 28 |.. */...|printf (|
|00002e80| 22 50 61 73 73 77 6f 72 | 64 20 45 78 70 69 72 65 |"Passwor|d Expire|
|00002e90| 73 3a 5c 74 22 29 3b 0a | 09 69 66 20 28 6c 61 73 |s:\t");.|.if (las|
|00002ea0| 74 64 61 79 20 3c 3d 20 | 30 20 7c 7c 20 6d 61 78 |tday <= |0 || max|
|00002eb0| 64 61 79 73 20 3e 3d 20 | 31 30 30 30 30 2a 28 44 |days >= |10000*(D|
|00002ec0| 41 59 2f 53 43 41 4c 45 | 29 20 7c 7c 20 6d 61 78 |AY/SCALE|) || max|
|00002ed0| 64 61 79 73 20 3c 3d 20 | 30 29 20 7b 0a 09 09 70 |days <= |0) {...p|
|00002ee0| 72 69 6e 74 66 20 28 22 | 4e 65 76 65 72 5c 6e 22 |rintf ("|Never\n"|
|00002ef0| 29 3b 0a 09 7d 20 65 6c | 73 65 20 7b 0a 09 09 65 |);..} el|se {...e|
|00002f00| 78 70 69 72 65 73 20 3d | 20 63 68 61 6e 67 65 64 |xpires =| changed|
|00002f10| 20 2b 20 6d 61 78 64 61 | 79 73 20 2a 20 53 43 41 | + maxda|ys * SCA|
|00002f20| 4c 45 3b 0a 09 09 74 70 | 20 3d 20 67 6d 74 69 6d |LE;...tp| = gmtim|
|00002f30| 65 20 28 26 65 78 70 69 | 72 65 73 29 3b 0a 09 09 |e (&expi|res);...|
|00002f40| 63 70 20 3d 20 61 73 63 | 74 69 6d 65 20 28 74 70 |cp = asc|time (tp|
|00002f50| 29 3b 0a 09 09 70 72 69 | 6e 74 66 20 28 22 25 36 |);...pri|ntf ("%6|
|00002f60| 2e 36 73 2c 20 25 34 2e | 34 73 5c 6e 22 2c 20 63 |.6s, %4.|4s\n", c|
|00002f70| 70 20 2b 20 34 2c 20 63 | 70 20 2b 20 32 30 29 3b |p + 4, c|p + 20);|
|00002f80| 0a 09 7d 0a 0a 09 2f 2a | 0a 09 20 2a 20 54 68 65 |..}.../*|.. * The|
|00002f90| 20 61 63 63 6f 75 6e 74 | 20 62 65 63 6f 6d 65 73 | account| becomes|
|00002fa0| 20 69 6e 61 63 74 69 76 | 65 20 69 66 20 74 68 65 | inactiv|e if the|
|00002fb0| 20 70 61 73 73 77 6f 72 | 64 20 69 73 20 65 78 70 | passwor|d is exp|
|00002fc0| 69 72 65 64 0a 09 20 2a | 20 66 6f 72 20 6d 6f 72 |ired.. *| for mor|
|00002fd0| 65 20 74 68 61 6e 20 22 | 69 6e 61 63 74 64 61 79 |e than "|inactday|
|00002fe0| 73 22 2e 20 20 54 68 65 | 20 65 78 70 69 72 61 74 |s". The| expirat|
|00002ff0| 69 6f 6e 20 64 61 74 65 | 20 69 73 20 63 61 6c 63 |ion date| is calc|
|00003000| 75 6c 61 74 65 64 0a 09 | 20 2a 20 61 6e 64 20 74 |ulated..| * and t|
|00003010| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 69 6e 61 |he numbe|r of ina|
|00003020| 63 74 69 76 65 20 64 61 | 79 73 20 69 73 20 61 64 |ctive da|ys is ad|
|00003030| 64 65 64 2e 20 20 54 68 | 65 20 72 65 73 75 6c 74 |ded. Th|e result|
|00003040| 69 6e 67 20 64 61 74 65 | 0a 09 20 2a 20 69 73 20 |ing date|.. * is |
|00003050| 77 68 65 6e 20 74 68 65 | 20 61 63 74 69 76 65 20 |when the| active |
|00003060| 77 69 6c 6c 20 62 65 20 | 64 69 73 61 62 6c 65 64 |will be |disabled|
|00003070| 2e 0a 09 20 2a 2f 0a 0a | 09 70 72 69 6e 74 66 20 |... */..|.printf |
|00003080| 28 22 50 61 73 73 77 6f | 72 64 20 49 6e 61 63 74 |("Passwo|rd Inact|
|00003090| 69 76 65 3a 5c 74 22 29 | 3b 0a 09 69 66 20 28 6c |ive:\t")|;..if (l|
|000030a0| 61 73 74 64 61 79 20 3c | 3d 20 30 20 7c 7c 20 69 |astday <|= 0 || i|
|000030b0| 6e 61 63 74 64 61 79 73 | 20 3c 3d 20 30 20 7c 7c |nactdays| <= 0 |||
|000030c0| 0a 09 09 09 6d 61 78 64 | 61 79 73 20 3e 3d 20 31 |....maxd|ays >= 1|
|000030d0| 30 30 30 30 2a 28 44 41 | 59 2f 53 43 41 4c 45 29 |0000*(DA|Y/SCALE)|
|000030e0| 20 7c 7c 20 6d 61 78 64 | 61 79 73 20 3c 3d 20 30 | || maxd|ays <= 0|
|000030f0| 29 20 7b 0a 09 09 70 72 | 69 6e 74 66 20 28 22 4e |) {...pr|intf ("N|
|00003100| 65 76 65 72 5c 6e 22 29 | 3b 0a 09 7d 20 65 6c 73 |ever\n")|;..} els|
|00003110| 65 20 7b 0a 09 09 65 78 | 70 69 72 65 73 20 3d 20 |e {...ex|pires = |
|00003120| 63 68 61 6e 67 65 64 20 | 2b 20 28 6d 61 78 64 61 |changed |+ (maxda|
|00003130| 79 73 20 2b 20 69 6e 61 | 63 74 64 61 79 73 29 20 |ys + ina|ctdays) |
|00003140| 2a 20 53 43 41 4c 45 3b | 0a 09 09 74 70 20 3d 20 |* SCALE;|...tp = |
|00003150| 67 6d 74 69 6d 65 20 28 | 26 65 78 70 69 72 65 73 |gmtime (|&expires|
|00003160| 29 3b 0a 09 09 63 70 20 | 3d 20 61 73 63 74 69 6d |);...cp |= asctim|
|00003170| 65 20 28 74 70 29 3b 0a | 09 09 70 72 69 6e 74 66 |e (tp);.|..printf|
|00003180| 20 28 22 25 36 2e 36 73 | 2c 20 25 34 2e 34 73 5c | ("%6.6s|, %4.4s\|
|00003190| 6e 22 2c 20 63 70 20 2b | 20 34 2c 20 63 70 20 2b |n", cp +| 4, cp +|
|000031a0| 20 32 30 29 3b 0a 09 7d | 0a 0a 09 2f 2a 0a 09 20 | 20);..}|.../*.. |
|000031b0| 2a 20 54 68 65 20 61 63 | 63 6f 75 6e 74 20 77 69 |* The ac|count wi|
|000031c0| 6c 6c 20 65 78 70 69 72 | 65 20 6f 6e 20 74 68 65 |ll expir|e on the|
|000031d0| 20 67 69 76 65 6e 20 64 | 61 74 65 20 72 65 67 61 | given d|ate rega|
|000031e0| 72 64 6c 65 73 73 20 6f | 66 20 74 68 65 0a 09 20 |rdless o|f the.. |
|000031f0| 2a 20 70 61 73 73 77 6f | 72 64 20 65 78 70 69 72 |* passwo|rd expir|
|00003200| 69 6e 67 20 6f 72 20 6e | 6f 74 2e 0a 09 20 2a 2f |ing or n|ot... */|
|00003210| 0a 0a 09 70 72 69 6e 74 | 66 20 28 22 41 63 63 6f |...print|f ("Acco|
|00003220| 75 6e 74 20 45 78 70 69 | 72 65 73 3a 5c 74 22 29 |unt Expi|res:\t")|
|00003230| 3b 0a 09 69 66 20 28 65 | 78 70 64 61 79 73 20 3c |;..if (e|xpdays <|
|00003240| 3d 20 30 29 20 7b 0a 09 | 09 70 72 69 6e 74 66 20 |= 0) {..|.printf |
|00003250| 28 22 4e 65 76 65 72 5c | 6e 22 29 3b 0a 09 7d 20 |("Never\|n");..} |
|00003260| 65 6c 73 65 20 7b 0a 09 | 09 65 78 70 69 72 65 73 |else {..|.expires|
|00003270| 20 3d 20 65 78 70 64 61 | 79 73 20 2a 20 53 43 41 | = expda|ys * SCA|
|00003280| 4c 45 3b 0a 09 09 74 70 | 20 3d 20 67 6d 74 69 6d |LE;...tp| = gmtim|
|00003290| 65 20 28 26 65 78 70 69 | 72 65 73 29 3b 0a 09 09 |e (&expi|res);...|
|000032a0| 63 70 20 3d 20 61 73 63 | 74 69 6d 65 20 28 74 70 |cp = asc|time (tp|
|000032b0| 29 3b 0a 09 09 70 72 69 | 6e 74 66 20 28 22 25 36 |);...pri|ntf ("%6|
|000032c0| 2e 36 73 2c 20 25 34 2e | 34 73 5c 6e 22 2c 20 63 |.6s, %4.|4s\n", c|
|000032d0| 70 20 2b 20 34 2c 20 63 | 70 20 2b 20 32 30 29 3b |p + 4, c|p + 20);|
|000032e0| 0a 09 7d 0a 7d 0a 0a 2f | 2a 0a 20 2a 20 63 68 61 |..}.}../|*. * cha|
|000032f0| 67 65 20 2d 20 63 68 61 | 6e 67 65 20 61 20 75 73 |ge - cha|nge a us|
|00003300| 65 72 27 73 20 70 61 73 | 73 77 6f 72 64 20 61 67 |er's pas|sword ag|
|00003310| 69 6e 67 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 0a |ing info|rmation.|
|00003320| 20 2a 0a 20 2a 09 54 68 | 69 73 20 63 6f 6d 6d 61 | *. *.Th|is comma|
|00003330| 6e 64 20 63 6f 6e 74 72 | 6f 6c 73 20 74 68 65 20 |nd contr|ols the |
|00003340| 70 61 73 73 77 6f 72 64 | 20 61 67 69 6e 67 20 69 |password| aging i|
|00003350| 6e 66 6f 72 6d 61 74 69 | 6f 6e 2e 0a 20 2a 0a 20 |nformati|on.. *. |
|00003360| 2a 09 54 68 65 20 76 61 | 6c 69 64 20 6f 70 74 69 |*.The va|lid opti|
|00003370| 6f 6e 73 20 61 72 65 0a | 20 2a 0a 20 2a 09 2d 6d |ons are.| *. *.-m|
|00003380| 09 6d 69 6e 69 6d 75 6d | 20 6e 75 6d 62 65 72 20 |.minimum| number |
|00003390| 6f 66 20 64 61 79 73 20 | 62 65 66 6f 72 65 20 70 |of days |before p|
|000033a0| 61 73 73 77 6f 72 64 20 | 63 68 61 6e 67 65 20 28 |assword |change (|
|000033b0| 2a 29 0a 20 2a 09 2d 4d | 09 6d 61 78 69 6d 69 6d |*). *.-M|.maximim|
|000033c0| 20 6e 75 6d 62 65 72 20 | 6f 66 20 64 61 79 73 20 | number |of days |
|000033d0| 62 65 66 6f 72 65 20 70 | 61 73 73 77 6f 72 64 20 |before p|assword |
|000033e0| 63 68 61 6e 67 65 20 28 | 2a 29 0a 20 2a 09 2d 64 |change (|*). *.-d|
|000033f0| 09 6c 61 73 74 20 70 61 | 73 73 77 6f 72 64 20 63 |.last pa|ssword c|
|00003400| 68 61 6e 67 65 20 64 61 | 74 65 20 28 2a 29 0a 20 |hange da|te (*). |
|00003410| 2a 09 2d 6c 09 6c 61 73 | 74 20 70 61 73 73 77 6f |*.-l.las|t passwo|
|00003420| 72 64 20 63 68 61 6e 67 | 65 20 64 61 74 65 0a 20 |rd chang|e date. |
|00003430| 2a 09 2d 57 09 65 78 70 | 69 72 61 74 69 6f 6e 20 |*.-W.exp|iration |
|00003440| 77 61 72 6e 69 6e 67 20 | 64 61 79 73 20 28 2a 29 |warning |days (*)|
|00003450| 0a 20 2a 09 2d 49 09 70 | 61 73 73 77 6f 72 64 20 |. *.-I.p|assword |
|00003460| 69 6e 61 63 74 69 76 65 | 20 61 66 74 65 72 20 65 |inactive| after e|
|00003470| 78 70 69 72 61 74 69 6f | 6e 20 28 2a 29 0a 20 2a |xpiratio|n (*). *|
|00003480| 09 2d 45 09 61 63 63 6f | 75 6e 74 20 65 78 70 69 |.-E.acco|unt expi|
|00003490| 72 61 74 69 6f 6e 20 64 | 61 74 65 20 28 2a 29 0a |ration d|ate (*).|
|000034a0| 20 2a 0a 20 2a 09 28 2a | 29 20 72 65 71 75 69 72 | *. *.(*|) requir|
|000034b0| 65 73 20 72 6f 6f 74 20 | 70 65 72 6d 69 73 73 69 |es root |permissi|
|000034c0| 6f 6e 20 74 6f 20 65 78 | 65 63 75 74 65 2e 0a 20 |on to ex|ecute.. |
|000034d0| 2a 0a 20 2a 09 41 6c 6c | 20 6f 66 20 74 68 65 20 |*. *.All| of the |
|000034e0| 74 69 6d 65 20 66 69 65 | 6c 64 73 20 61 72 65 20 |time fie|lds are |
|000034f0| 65 6e 74 65 72 65 64 20 | 69 6e 20 74 68 65 20 69 |entered |in the i|
|00003500| 6e 74 65 72 6e 61 6c 20 | 66 6f 72 6d 61 74 0a 20 |nternal |format. |
|00003510| 2a 09 77 68 69 63 68 20 | 69 73 20 65 69 74 68 65 |*.which |is eithe|
|00003520| 72 20 73 65 63 6f 6e 64 | 73 20 6f 72 20 64 61 79 |r second|s or day|
|00003530| 73 2e 0a 20 2a 2f 0a 0a | 69 6e 74 0a 6d 61 69 6e |s.. */..|int.main|
|00003540| 20 28 61 72 67 63 2c 20 | 61 72 67 76 29 0a 69 6e | (argc, |argv).in|
|00003550| 74 09 61 72 67 63 3b 0a | 63 68 61 72 09 2a 2a 61 |t.argc;.|char.**a|
|00003560| 72 67 76 3b 0a 7b 0a 09 | 69 6e 74 09 66 6c 61 67 |rgv;.{..|int.flag|
|00003570| 3b 0a 09 69 6e 74 09 6c | 66 6c 67 20 3d 20 30 3b |;..int.l|flg = 0;|
|00003580| 0a 09 69 6e 74 09 6d 66 | 6c 67 20 3d 20 30 3b 0a |..int.mf|lg = 0;.|
|00003590| 09 69 6e 74 09 4d 66 6c | 67 20 3d 20 30 3b 0a 09 |.int.Mfl|g = 0;..|
|000035a0| 69 6e 74 09 64 66 6c 67 | 20 3d 20 30 3b 0a 09 69 |int.dflg| = 0;..i|
|000035b0| 6e 74 09 57 66 6c 67 20 | 3d 20 30 3b 0a 09 69 6e |nt.Wflg |= 0;..in|
|000035c0| 74 09 49 66 6c 67 20 3d | 20 30 3b 0a 09 69 6e 74 |t.Iflg =| 0;..int|
|000035d0| 09 45 66 6c 67 20 3d 20 | 30 3b 0a 09 69 6e 74 09 |.Eflg = |0;..int.|
|000035e0| 72 75 69 64 20 3d 20 67 | 65 74 75 69 64 20 28 29 |ruid = g|etuid ()|
|000035f0| 3b 0a 09 73 74 72 75 63 | 74 09 70 61 73 73 77 64 |;..struc|t.passwd|
|00003600| 09 2a 70 77 3b 0a 09 73 | 74 72 75 63 74 09 70 61 |.*pw;..s|truct.pa|
|00003610| 73 73 77 64 09 70 77 65 | 6e 74 3b 0a 09 73 74 72 |sswd.pwe|nt;..str|
|00003620| 75 63 74 09 73 70 77 64 | 09 2a 73 70 3b 0a 09 73 |uct.spwd|.*sp;..s|
|00003630| 74 72 75 63 74 09 73 70 | 77 64 09 73 70 77 64 3b |truct.sp|wd.spwd;|
|00003640| 0a 09 63 68 61 72 09 6e | 61 6d 65 5b 42 55 46 53 |..char.n|ame[BUFS|
|00003650| 49 5a 5d 3b 0a 0a 09 2f | 2a 0a 09 20 2a 20 47 65 |IZ];.../|*.. * Ge|
|00003660| 74 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 6e 61 |t the pr|ogram na|
|00003670| 6d 65 20 73 6f 20 74 68 | 61 74 20 65 72 72 6f 72 |me so th|at error|
|00003680| 20 6d 65 73 73 61 67 65 | 73 20 63 61 6e 20 75 73 | message|s can us|
|00003690| 65 20 69 74 2e 0a 09 20 | 2a 2f 0a 0a 09 69 66 20 |e it... |*/...if |
|000036a0| 28 50 72 6f 67 20 3d 20 | 73 74 72 72 63 68 72 20 |(Prog = |strrchr |
|000036b0| 28 61 72 67 76 5b 30 5d | 2c 20 27 2f 27 29 29 0a |(argv[0]|, '/')).|
|000036c0| 09 09 50 72 6f 67 2b 2b | 3b 0a 09 65 6c 73 65 0a |..Prog++|;..else.|
|000036d0| 09 09 50 72 6f 67 20 3d | 20 61 72 67 76 5b 30 5d |..Prog =| argv[0]|
|000036e0| 3b 0a 0a 23 69 66 64 65 | 66 09 55 53 45 5f 53 59 |;..#ifde|f.USE_SY|
|000036f0| 53 4c 4f 47 0a 09 6f 70 | 65 6e 6c 6f 67 20 28 50 |SLOG..op|enlog (P|
|00003700| 72 6f 67 2c 20 4c 4f 47 | 5f 50 49 44 7c 4c 4f 47 |rog, LOG|_PID|LOG|
|00003710| 5f 43 4f 4e 53 7c 4c 4f | 47 5f 4e 4f 57 41 49 54 |_CONS|LO|G_NOWAIT|
|00003720| 2c 20 4c 4f 47 5f 41 55 | 54 48 29 3b 0a 23 65 6e |, LOG_AU|TH);.#en|
|00003730| 64 69 66 0a 23 69 66 64 | 65 66 09 4e 44 42 4d 0a |dif.#ifd|ef.NDBM.|
|00003740| 09 73 70 5f 64 62 6d 5f | 6d 6f 64 65 20 3d 20 4f |.sp_dbm_|mode = O|
|00003750| 5f 52 44 57 52 3b 0a 09 | 70 77 5f 64 62 6d 5f 6d |_RDWR;..|pw_dbm_m|
|00003760| 6f 64 65 20 3d 20 4f 5f | 52 44 57 52 3b 0a 23 65 |ode = O_|RDWR;.#e|
|00003770| 6e 64 69 66 0a 0a 09 2f | 2a 0a 09 20 2a 20 50 61 |ndif.../|*.. * Pa|
|00003780| 72 73 65 20 74 68 65 20 | 66 6c 61 67 73 2e 20 20 |rse the |flags. |
|00003790| 54 68 65 20 64 69 66 66 | 65 72 65 6e 63 65 20 62 |The diff|erence b|
|000037a0| 65 74 77 65 65 6e 20 70 | 61 73 73 77 6f 72 64 20 |etween p|assword |
|000037b0| 66 69 6c 65 0a 09 20 2a | 20 66 6f 72 6d 61 74 73 |file.. *| formats|
|000037c0| 20 69 6e 63 6c 75 64 65 | 73 20 74 68 65 20 6e 75 | include|s the nu|
|000037d0| 6d 62 65 72 20 6f 66 20 | 66 69 65 6c 64 73 2c 20 |mber of |fields, |
|000037e0| 61 6e 64 20 77 68 65 74 | 68 65 72 20 74 68 65 0a |and whet|her the.|
|000037f0| 09 20 2a 20 64 61 74 65 | 73 20 61 72 65 20 65 6e |. * date|s are en|
|00003800| 74 65 72 65 64 20 61 73 | 20 64 61 79 73 20 6f 72 |tered as| days or|
|00003810| 20 77 65 65 6b 73 2e 20 | 20 53 68 61 64 6f 77 20 | weeks. | Shadow |
|00003820| 70 61 73 73 77 6f 72 64 | 0a 09 20 2a 20 66 69 6c |password|.. * fil|
|00003830| 65 20 69 6e 66 6f 20 3d | 6d 75 73 74 3d 20 62 65 |e info =|must= be|
|00003840| 20 65 6e 74 65 72 65 64 | 20 69 6e 20 64 61 79 73 | entered| in days|
|00003850| 2c 20 77 68 69 6c 65 20 | 72 65 67 75 6c 61 72 0a |, while |regular.|
|00003860| 09 20 2a 20 70 61 73 73 | 77 6f 72 64 20 66 69 6c |. * pass|word fil|
|00003870| 65 20 69 6e 66 6f 20 3d | 6d 75 73 74 3d 20 62 65 |e info =|must= be|
|00003880| 20 65 6e 74 65 72 65 64 | 20 69 6e 20 77 65 65 6b | entered| in week|
|00003890| 73 2e 0a 09 20 2a 2f 0a | 0a 09 77 68 69 6c 65 20 |s... */.|..while |
|000038a0| 28 28 66 6c 61 67 20 3d | 20 67 65 74 6f 70 74 20 |((flag =| getopt |
|000038b0| 28 61 72 67 63 2c 20 61 | 72 67 76 2c 20 22 6c 6d |(argc, a|rgv, "lm|
|000038c0| 3a 4d 3a 57 3a 49 3a 45 | 3a 64 3a 22 29 29 20 21 |:M:W:I:E|:d:")) !|
|000038d0| 3d 20 45 4f 46 29 20 7b | 0a 09 09 73 77 69 74 63 |= EOF) {|...switc|
|000038e0| 68 20 28 66 6c 61 67 29 | 20 7b 0a 09 09 09 63 61 |h (flag)| {....ca|
|000038f0| 73 65 20 27 6c 27 3a 0a | 09 09 09 09 6c 66 6c 67 |se 'l':.|....lflg|
|00003900| 2b 2b 3b 0a 09 09 09 09 | 62 72 65 61 6b 3b 0a 09 |++;.....|break;..|
|00003910| 09 09 63 61 73 65 20 27 | 6d 27 3a 0a 09 09 09 09 |..case '|m':.....|
|00003920| 6d 66 6c 67 2b 2b 3b 0a | 09 09 09 09 6d 69 6e 64 |mflg++;.|....mind|
|00003930| 61 79 73 20 3d 20 73 74 | 72 74 6f 6c 20 28 6f 70 |ays = st|rtol (op|
|00003940| 74 61 72 67 2c 20 30 2c | 20 31 30 29 3b 0a 09 09 |targ, 0,| 10);...|
|00003950| 09 09 62 72 65 61 6b 3b | 0a 09 09 09 63 61 73 65 |..break;|....case|
|00003960| 20 27 4d 27 3a 0a 09 09 | 09 09 4d 66 6c 67 2b 2b | 'M':...|..Mflg++|
|00003970| 3b 0a 09 09 09 09 6d 61 | 78 64 61 79 73 20 3d 20 |;.....ma|xdays = |
|00003980| 73 74 72 74 6f 6c 20 28 | 6f 70 74 61 72 67 2c 20 |strtol (|optarg, |
|00003990| 30 2c 20 31 30 29 3b 0a | 09 09 09 09 62 72 65 61 |0, 10);.|....brea|
|000039a0| 6b 3b 0a 09 09 09 63 61 | 73 65 20 27 64 27 3a 0a |k;....ca|se 'd':.|
|000039b0| 09 09 09 09 64 66 6c 67 | 2b 2b 3b 0a 09 09 09 09 |....dflg|++;.....|
|000039c0| 6c 61 73 74 64 61 79 20 | 3d 20 73 74 72 74 6f 6c |lastday |= strtol|
|000039d0| 20 28 6f 70 74 61 72 67 | 2c 20 30 2c 20 31 30 29 | (optarg|, 0, 10)|
|000039e0| 3b 0a 09 09 09 09 62 72 | 65 61 6b 3b 0a 09 09 09 |;.....br|eak;....|
|000039f0| 63 61 73 65 20 27 57 27 | 3a 0a 09 09 09 09 57 66 |case 'W'|:.....Wf|
|00003a00| 6c 67 2b 2b 3b 0a 09 09 | 09 09 77 61 72 6e 64 61 |lg++;...|..warnda|
|00003a10| 79 73 20 3d 20 73 74 72 | 74 6f 6c 20 28 6f 70 74 |ys = str|tol (opt|
|00003a20| 61 72 67 2c 20 30 2c 20 | 31 30 29 3b 0a 09 09 09 |arg, 0, |10);....|
|00003a30| 09 62 72 65 61 6b 3b 0a | 09 09 09 63 61 73 65 20 |.break;.|...case |
|00003a40| 27 49 27 3a 0a 09 09 09 | 09 49 66 6c 67 2b 2b 3b |'I':....|.Iflg++;|
|00003a50| 0a 09 09 09 09 69 6e 61 | 63 74 64 61 79 73 20 3d |.....ina|ctdays =|
|00003a60| 20 73 74 72 74 6f 6c 20 | 28 6f 70 74 61 72 67 2c | strtol |(optarg,|
|00003a70| 20 30 2c 20 31 30 29 3b | 0a 09 09 09 09 62 72 65 | 0, 10);|.....bre|
|00003a80| 61 6b 3b 0a 09 09 09 63 | 61 73 65 20 27 45 27 3a |ak;....c|ase 'E':|
|00003a90| 0a 09 09 09 09 45 66 6c | 67 2b 2b 3b 0a 09 09 09 |.....Efl|g++;....|
|00003aa0| 09 65 78 70 64 61 79 73 | 20 3d 20 73 74 72 74 6f |.expdays| = strto|
|00003ab0| 6c 20 28 6f 70 74 61 72 | 67 2c 20 30 2c 20 31 30 |l (optar|g, 0, 10|
|00003ac0| 29 3b 0a 09 09 09 09 62 | 72 65 61 6b 3b 0a 09 09 |);.....b|reak;...|
|00003ad0| 09 64 65 66 61 75 6c 74 | 3a 0a 09 09 09 09 75 73 |.default|:.....us|
|00003ae0| 61 67 65 20 28 29 3b 0a | 09 09 7d 0a 09 7d 0a 0a |age ();.|..}..}..|
|00003af0| 09 2f 2a 0a 09 20 2a 20 | 4d 61 6b 65 20 63 65 72 |./*.. * |Make cer|
|00003b00| 74 61 69 6e 20 74 68 65 | 20 66 6c 61 67 73 20 64 |tain the| flags d|
|00003b10| 6f 20 6e 6f 74 20 63 6f | 6e 66 6c 69 63 74 20 61 |o not co|nflict a|
|00003b20| 6e 64 20 74 68 61 74 20 | 74 68 65 72 65 20 69 73 |nd that |there is|
|00003b30| 0a 09 20 2a 20 61 20 75 | 73 65 72 20 6e 61 6d 65 |.. * a u|ser name|
|00003b40| 20 6f 6e 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 20 | on the |command |
|00003b50| 6c 69 6e 65 2e 0a 09 20 | 2a 2f 0a 0a 09 69 66 20 |line... |*/...if |
|00003b60| 28 61 72 67 63 20 21 3d | 20 6f 70 74 69 6e 64 20 |(argc !=| optind |
|00003b70| 2b 20 31 29 0a 09 09 75 | 73 61 67 65 20 28 29 3b |+ 1)...u|sage ();|
|00003b80| 0a 0a 09 69 66 20 28 6c | 66 6c 67 20 26 26 20 28 |...if (l|flg && (|
|00003b90| 6d 66 6c 67 20 7c 7c 20 | 4d 66 6c 67 20 7c 7c 20 |mflg || |Mflg || |
|00003ba0| 64 66 6c 67 20 7c 7c 20 | 57 66 6c 67 20 7c 7c 20 |dflg || |Wflg || |
|00003bb0| 49 66 6c 67 20 7c 7c 20 | 45 66 6c 67 29 29 20 7b |Iflg || |Eflg)) {|
|00003bc0| 0a 09 09 66 70 72 69 6e | 74 66 20 28 73 74 64 65 |...fprin|tf (stde|
|00003bd0| 72 72 2c 20 4e 4f 5f 4c | 46 4c 41 47 2c 20 50 72 |rr, NO_L|FLAG, Pr|
|00003be0| 6f 67 29 3b 0a 23 69 66 | 64 65 66 09 55 53 45 5f |og);.#if|def.USE_|
|00003bf0| 53 59 53 4c 4f 47 0a 09 | 09 63 6c 6f 73 65 6c 6f |SYSLOG..|.closelo|
|00003c00| 67 20 28 29 3b 0a 23 65 | 6e 64 69 66 0a 09 09 75 |g ();.#e|ndif...u|
|00003c10| 73 61 67 65 20 28 29 3b | 0a 09 7d 0a 0a 09 2f 2a |sage ();|..}.../*|
|00003c20| 0a 09 20 2a 20 41 6e 20 | 75 6e 70 72 69 76 69 6c |.. * An |unprivil|
|00003c30| 65 67 65 64 20 75 73 65 | 72 20 63 61 6e 20 61 73 |eged use|r can as|
|00003c40| 6b 20 66 6f 72 20 74 68 | 65 69 72 20 6f 77 6e 20 |k for th|eir own |
|00003c50| 61 67 69 6e 67 20 69 6e | 66 6f 72 6d 61 74 69 6f |aging in|formatio|
|00003c60| 6e 2c 0a 09 20 2a 20 62 | 75 74 20 6f 6e 6c 79 20 |n,.. * b|ut only |
|00003c70| 72 6f 6f 74 20 63 61 6e | 20 63 68 61 6e 67 65 20 |root can| change |
|00003c80| 69 74 2c 20 6f 72 20 6c | 69 73 74 20 61 6e 6f 74 |it, or l|ist anot|
|00003c90| 68 65 72 20 75 73 65 72 | 27 73 20 61 67 69 6e 67 |her user|'s aging|
|00003ca0| 0a 09 20 2a 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |.. * inf|ormation|
|00003cb0| 2e 0a 09 20 2a 2f 0a 0a | 09 69 66 20 28 72 75 69 |... */..|.if (rui|
|00003cc0| 64 20 21 3d 20 30 20 26 | 26 20 21 20 6c 66 6c 67 |d != 0 &|& ! lflg|
|00003cd0| 29 20 7b 0a 09 09 66 70 | 72 69 6e 74 66 20 28 73 |) {...fp|rintf (s|
|00003ce0| 74 64 65 72 72 2c 20 4e | 4f 5f 50 45 52 4d 2c 20 |tderr, N|O_PERM, |
|00003cf0| 50 72 6f 67 29 3b 0a 23 | 69 66 64 65 66 09 55 53 |Prog);.#|ifdef.US|
|00003d00| 45 5f 53 59 53 4c 4f 47 | 0a 09 09 63 6c 6f 73 65 |E_SYSLOG|...close|
|00003d10| 6c 6f 67 20 28 29 3b 0a | 23 65 6e 64 69 66 0a 09 |log ();.|#endif..|
|00003d20| 09 65 78 69 74 20 28 31 | 29 3b 0a 09 7d 0a 0a 09 |.exit (1|);..}...|
|00003d30| 2f 2a 0a 09 20 2a 20 4c | 6f 63 6b 20 61 6e 64 20 |/*.. * L|ock and |
|00003d40| 6f 70 65 6e 20 74 68 65 | 20 70 61 73 73 77 6f 72 |open the| passwor|
|00003d50| 64 20 66 69 6c 65 2e 20 | 20 54 68 69 73 20 6c 6f |d file. | This lo|
|00003d60| 61 64 73 20 61 6c 6c 20 | 6f 66 20 74 68 65 0a 09 |ads all |of the..|
|00003d70| 20 2a 20 70 61 73 73 77 | 6f 72 64 20 66 69 6c 65 | * passw|ord file|
|00003d80| 20 65 6e 74 72 69 65 73 | 20 69 6e 74 6f 20 6d 65 | entries| into me|
|00003d90| 6d 6f 72 79 2e 20 20 54 | 68 65 6e 20 77 65 20 67 |mory. T|hen we g|
|00003da0| 65 74 20 61 20 70 6f 69 | 6e 74 65 72 0a 09 20 2a |et a poi|nter.. *|
|00003db0| 20 74 6f 20 74 68 65 20 | 70 61 73 73 77 6f 72 64 | to the |password|
|00003dc0| 20 66 69 6c 65 20 65 6e | 74 72 79 20 66 6f 72 20 | file en|try for |
|00003dd0| 74 68 65 20 72 65 71 75 | 65 73 74 65 64 20 75 73 |the requ|ested us|
|00003de0| 65 72 2e 0a 09 20 2a 2f | 0a 0a 09 69 66 20 28 21 |er... */|...if (!|
|00003df0| 20 70 77 5f 6c 6f 63 6b | 20 28 29 29 20 7b 0a 09 | pw_lock| ()) {..|
|00003e00| 09 66 70 72 69 6e 74 66 | 20 28 73 74 64 65 72 72 |.fprintf| (stderr|
|00003e10| 2c 20 4e 4f 5f 50 57 4c | 4f 43 4b 2c 20 50 72 6f |, NO_PWL|OCK, Pro|
|00003e20| 67 29 3b 0a 23 69 66 64 | 65 66 09 55 53 45 5f 53 |g);.#ifd|ef.USE_S|
|00003e30| 59 53 4c 4f 47 0a 09 09 | 73 79 73 6c 6f 67 20 28 |YSLOG...|syslog (|
|00003e40| 4c 4f 47 5f 45 52 52 2c | 20 4c 4f 43 4b 5f 46 41 |LOG_ERR,| LOCK_FA|
|00003e50| 49 4c 2c 20 22 2f 65 74 | 63 2f 70 61 73 73 77 64 |IL, "/et|c/passwd|
|00003e60| 22 29 3b 0a 09 09 63 6c | 6f 73 65 6c 6f 67 20 28 |");...cl|oselog (|
|00003e70| 29 3b 0a 23 65 6e 64 69 | 66 0a 09 09 65 78 69 74 |);.#endi|f...exit|
|00003e80| 20 28 31 29 3b 0a 09 7d | 0a 09 69 66 20 28 21 20 | (1);..}|..if (! |
|00003e90| 70 77 5f 6f 70 65 6e 20 | 28 72 75 69 64 20 21 3d |pw_open |(ruid !=|
|00003ea0| 20 30 20 7c 7c 20 6c 66 | 6c 67 20 3f 20 4f 5f 52 | 0 || lf|lg ? O_R|
|00003eb0| 44 4f 4e 4c 59 3a 4f 5f | 52 44 57 52 29 29 20 7b |DONLY:O_|RDWR)) {|
|00003ec0| 0a 09 09 66 70 72 69 6e | 74 66 20 28 73 74 64 65 |...fprin|tf (stde|
|00003ed0| 72 72 2c 20 4e 4f 5f 50 | 57 4f 50 45 4e 2c 20 50 |rr, NO_P|WOPEN, P|
|00003ee0| 72 6f 67 29 3b 0a 09 09 | 63 6c 65 61 6e 75 70 20 |rog);...|cleanup |
|00003ef0| 28 31 29 3b 0a 23 69 66 | 64 65 66 09 55 53 45 5f |(1);.#if|def.USE_|
|00003f00| 53 59 53 4c 4f 47 0a 09 | 09 73 79 73 6c 6f 67 20 |SYSLOG..|.syslog |
|00003f10| 28 4c 4f 47 5f 45 52 52 | 2c 20 4f 50 45 4e 5f 46 |(LOG_ERR|, OPEN_F|
|00003f20| 41 49 4c 2c 20 22 2f 65 | 74 63 2f 70 61 73 73 77 |AIL, "/e|tc/passw|
|00003f30| 64 22 29 3b 0a 09 09 63 | 6c 6f 73 65 6c 6f 67 20 |d");...c|loselog |
|00003f40| 28 29 3b 0a 23 65 6e 64 | 69 66 0a 09 09 65 78 69 |();.#end|if...exi|
|00003f50| 74 20 28 31 29 3b 0a 09 | 7d 0a 09 69 66 20 28 21 |t (1);..|}..if (!|
|00003f60| 20 28 70 77 20 3d 20 70 | 77 5f 6c 6f 63 61 74 65 | (pw = p|w_locate|
|00003f70| 20 28 61 72 67 76 5b 6f | 70 74 69 6e 64 5d 29 29 | (argv[o|ptind]))|
|00003f80| 29 20 7b 0a 09 09 66 70 | 72 69 6e 74 66 20 28 73 |) {...fp|rintf (s|
|00003f90| 74 64 65 72 72 2c 20 55 | 4e 4b 5f 55 53 45 52 2c |tderr, U|NK_USER,|
|00003fa0| 20 50 72 6f 67 2c 20 61 | 72 67 76 5b 6f 70 74 69 | Prog, a|rgv[opti|
|00003fb0| 6e 64 5d 29 3b 0a 09 09 | 63 6c 65 61 6e 75 70 20 |nd]);...|cleanup |
|00003fc0| 28 31 29 3b 0a 23 69 66 | 64 65 66 09 55 53 45 5f |(1);.#if|def.USE_|
|00003fd0| 53 59 53 4c 4f 47 0a 09 | 09 63 6c 6f 73 65 6c 6f |SYSLOG..|.closelo|
|00003fe0| 67 20 28 29 3b 0a 23 65 | 6e 64 69 66 0a 09 09 65 |g ();.#e|ndif...e|
|00003ff0| 78 69 74 20 28 31 29 3b | 0a 09 7d 0a 0a 09 2f 2a |xit (1);|..}.../*|
|00004000| 0a 09 20 2a 20 46 6f 72 | 20 73 68 61 64 6f 77 20 |.. * For| shadow |
|00004010| 70 61 73 73 77 6f 72 64 | 20 66 69 6c 65 73 20 77 |password| files w|
|00004020| 65 20 68 61 76 65 20 74 | 6f 20 6c 6f 63 6b 20 74 |e have t|o lock t|
|00004030| 68 65 20 66 69 6c 65 20 | 61 6e 64 0a 09 20 2a 20 |he file |and.. * |
|00004040| 72 65 61 64 20 69 6e 20 | 74 68 65 20 65 6e 74 72 |read in |the entr|
|00004050| 69 65 73 20 61 73 20 77 | 61 73 20 64 6f 6e 65 20 |ies as w|as done |
|00004060| 66 6f 72 20 74 68 65 20 | 70 61 73 73 77 6f 72 64 |for the |password|
|00004070| 20 66 69 6c 65 2e 0a 09 | 20 2a 20 54 68 65 20 75 | file...| * The u|
|00004080| 73 65 72 20 65 6e 74 72 | 69 65 73 20 64 6f 65 73 |ser entr|ies does|
|00004090| 20 6e 6f 74 20 68 61 76 | 65 20 74 6f 20 65 78 69 | not hav|e to exi|
|000040a0| 73 74 20 69 6e 20 74 68 | 69 73 20 63 61 73 65 3b |st in th|is case;|
|000040b0| 0a 09 20 2a 20 61 20 6e | 65 77 20 65 6e 74 72 79 |.. * a n|ew entry|
|000040c0| 20 77 69 6c 6c 20 62 65 | 20 63 72 65 61 74 65 64 | will be| created|
|000040d0| 20 66 6f 72 20 74 68 69 | 73 20 75 73 65 72 20 69 | for thi|s user i|
|000040e0| 66 20 6f 6e 65 20 64 6f | 65 73 0a 09 20 2a 20 6e |f one do|es.. * n|
|000040f0| 6f 74 20 65 78 69 73 74 | 20 61 6c 72 65 61 64 79 |ot exist| already|
|00004100| 2e 0a 09 20 2a 2f 0a 0a | 09 69 66 20 28 21 20 73 |... */..|.if (! s|
|00004110| 70 77 5f 6c 6f 63 6b 20 | 28 29 29 20 7b 0a 09 09 |pw_lock |()) {...|
|00004120| 66 70 72 69 6e 74 66 20 | 28 73 74 64 65 72 72 2c |fprintf |(stderr,|
|00004130| 20 4e 4f 5f 53 50 4c 4f | 43 4b 2c 20 50 72 6f 67 | NO_SPLO|CK, Prog|
|00004140| 29 3b 0a 09 09 63 6c 65 | 61 6e 75 70 20 28 31 29 |);...cle|anup (1)|
|00004150| 3b 0a 23 69 66 64 65 66 | 09 55 53 45 5f 53 59 53 |;.#ifdef|.USE_SYS|
|00004160| 4c 4f 47 0a 09 09 73 79 | 73 6c 6f 67 20 28 4c 4f |LOG...sy|slog (LO|
|00004170| 47 5f 45 52 52 2c 20 4c | 4f 43 4b 5f 46 41 49 4c |G_ERR, L|OCK_FAIL|
|00004180| 2c 20 22 2f 65 74 63 2f | 73 68 61 64 6f 77 22 29 |, "/etc/|shadow")|
|00004190| 3b 0a 09 09 63 6c 6f 73 | 65 6c 6f 67 20 28 29 3b |;...clos|elog ();|
|000041a0| 0a 23 65 6e 64 69 66 0a | 09 09 65 78 69 74 20 28 |.#endif.|..exit (|
|000041b0| 31 29 3b 0a 09 7d 0a 09 | 69 66 20 28 21 20 73 70 |1);..}..|if (! sp|
|000041c0| 77 5f 6f 70 65 6e 20 28 | 28 72 75 69 64 20 21 3d |w_open (|(ruid !=|
|000041d0| 20 30 20 7c 7c 20 6c 66 | 6c 67 29 20 3f 20 4f 5f | 0 || lf|lg) ? O_|
|000041e0| 52 44 4f 4e 4c 59 3a 4f | 5f 52 44 57 52 29 29 20 |RDONLY:O|_RDWR)) |
|000041f0| 7b 0a 09 09 66 70 72 69 | 6e 74 66 20 28 73 74 64 |{...fpri|ntf (std|
|00004200| 65 72 72 2c 20 4e 4f 5f | 53 50 4f 50 45 4e 2c 20 |err, NO_|SPOPEN, |
|00004210| 50 72 6f 67 29 3b 0a 09 | 09 63 6c 65 61 6e 75 70 |Prog);..|.cleanup|
|00004220| 20 28 32 29 3b 0a 23 69 | 66 64 65 66 09 55 53 45 | (2);.#i|fdef.USE|
|00004230| 5f 53 59 53 4c 4f 47 0a | 09 09 73 79 73 6c 6f 67 |_SYSLOG.|..syslog|
|00004240| 20 28 4c 4f 47 5f 45 52 | 52 2c 20 4f 50 45 4e 5f | (LOG_ER|R, OPEN_|
|00004250| 46 41 49 4c 2c 20 22 2f | 65 74 63 2f 73 68 61 64 |FAIL, "/|etc/shad|
|00004260| 6f 77 22 29 3b 0a 09 09 | 63 6c 6f 73 65 6c 6f 67 |ow");...|closelog|
|00004270| 20 28 29 3b 0a 23 65 6e | 64 69 66 0a 09 09 65 78 | ();.#en|dif...ex|
|00004280| 69 74 20 28 31 29 3b 0a | 09 7d 0a 09 69 66 20 28 |it (1);.|.}..if (|
|00004290| 73 70 20 3d 20 73 70 77 | 5f 6c 6f 63 61 74 65 20 |sp = spw|_locate |
|000042a0| 28 61 72 67 76 5b 6f 70 | 74 69 6e 64 5d 29 29 0a |(argv[op|tind])).|
|000042b0| 09 09 73 70 77 64 20 3d | 20 2a 73 70 3b 0a 0a 09 |..spwd =| *sp;...|
|000042c0| 73 74 72 63 70 79 20 28 | 6e 61 6d 65 2c 20 70 77 |strcpy (|name, pw|
|000042d0| 2d 3e 70 77 5f 6e 61 6d | 65 29 3b 0a 09 70 77 65 |->pw_nam|e);..pwe|
|000042e0| 6e 74 20 3d 20 2a 70 77 | 3b 0a 0a 09 2f 2a 0a 09 |nt = *pw|;.../*..|
|000042f0| 20 2a 20 53 65 74 20 74 | 68 65 20 66 69 65 6c 64 | * Set t|he field|
|00004300| 73 20 74 68 61 74 20 61 | 72 65 6e 27 74 20 62 65 |s that a|ren't be|
|00004310| 69 6e 67 20 73 65 74 20 | 66 72 6f 6d 20 74 68 65 |ing set |from the|
|00004320| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 0a 09 20 | command| line.. |
|00004330| 2a 20 66 72 6f 6d 20 74 | 68 65 20 70 61 73 73 77 |* from t|he passw|
|00004340| 6f 72 64 20 66 69 6c 65 | 2e 0a 09 20 2a 2f 0a 0a |ord file|... */..|
|00004350| 09 69 66 20 28 73 70 29 | 20 7b 0a 09 09 69 66 20 |.if (sp)| {...if |
|00004360| 28 21 20 4d 66 6c 67 29 | 0a 09 09 09 6d 61 78 64 |(! Mflg)|....maxd|
|00004370| 61 79 73 20 3d 20 73 70 | 77 64 2e 73 70 5f 6d 61 |ays = sp|wd.sp_ma|
|00004380| 78 3b 0a 09 09 69 66 20 | 28 21 20 6d 66 6c 67 29 |x;...if |(! mflg)|
|00004390| 0a 09 09 09 6d 69 6e 64 | 61 79 73 20 3d 20 73 70 |....mind|ays = sp|
|000043a0| 77 64 2e 73 70 5f 6d 69 | 6e 3b 0a 09 09 69 66 20 |wd.sp_mi|n;...if |
|000043b0| 28 21 20 64 66 6c 67 29 | 0a 09 09 09 6c 61 73 74 |(! dflg)|....last|
|000043c0| 64 61 79 20 3d 20 73 70 | 77 64 2e 73 70 5f 6c 73 |day = sp|wd.sp_ls|
|000043d0| 74 63 68 67 3b 0a 09 09 | 69 66 20 28 21 20 57 66 |tchg;...|if (! Wf|
|000043e0| 6c 67 29 0a 09 09 09 77 | 61 72 6e 64 61 79 73 20 |lg)....w|arndays |
|000043f0| 3d 20 73 70 77 64 2e 73 | 70 5f 77 61 72 6e 3b 0a |= spwd.s|p_warn;.|
|00004400| 09 09 69 66 20 28 21 20 | 49 66 6c 67 29 0a 09 09 |..if (! |Iflg)...|
|00004410| 09 69 6e 61 63 74 64 61 | 79 73 20 3d 20 73 70 77 |.inactda|ys = spw|
|00004420| 64 2e 73 70 5f 69 6e 61 | 63 74 3b 0a 09 09 69 66 |d.sp_ina|ct;...if|
|00004430| 20 28 21 20 45 66 6c 67 | 29 0a 09 09 09 65 78 70 | (! Eflg|)....exp|
|00004440| 64 61 79 73 20 3d 20 73 | 70 77 64 2e 73 70 5f 65 |days = s|pwd.sp_e|
|00004450| 78 70 69 72 65 3b 0a 09 | 7d 20 65 6c 73 65 0a 23 |xpire;..|} else.#|
|00004460| 69 66 64 65 66 09 41 54 | 54 5f 41 47 45 0a 09 7b |ifdef.AT|T_AGE..{|
|00004470| 0a 09 09 69 66 20 28 70 | 77 65 6e 74 2e 70 77 5f |...if (p|went.pw_|
|00004480| 61 67 65 20 26 26 20 73 | 74 72 6c 65 6e 20 28 70 |age && s|trlen (p|
|00004490| 77 65 6e 74 2e 70 77 5f | 61 67 65 29 20 3e 3d 20 |went.pw_|age) >= |
|000044a0| 32 29 20 7b 0a 09 09 09 | 69 66 20 28 21 20 4d 66 |2) {....|if (! Mf|
|000044b0| 6c 67 29 0a 09 09 09 09 | 6d 61 78 64 61 79 73 20 |lg).....|maxdays |
|000044c0| 3d 20 63 36 34 69 20 28 | 70 77 65 6e 74 2e 70 77 |= c64i (|pwent.pw|
|000044d0| 5f 61 67 65 5b 30 5d 29 | 20 2a 20 28 57 45 45 4b |_age[0])| * (WEEK|
|000044e0| 2f 53 43 41 4c 45 29 3b | 0a 09 09 09 69 66 20 28 |/SCALE);|....if (|
|000044f0| 21 20 6d 66 6c 67 29 0a | 09 09 09 09 6d 69 6e 64 |! mflg).|....mind|
|00004500| 61 79 73 20 3d 20 63 36 | 34 69 20 28 70 77 65 6e |ays = c6|4i (pwen|
|00004510| 74 2e 70 77 5f 61 67 65 | 5b 31 5d 29 20 2a 20 28 |t.pw_age|[1]) * (|
|00004520| 57 45 45 4b 2f 53 43 41 | 4c 45 29 3b 0a 09 09 09 |WEEK/SCA|LE);....|
|00004530| 69 66 20 28 21 20 64 66 | 6c 67 20 26 26 20 73 74 |if (! df|lg && st|
|00004540| 72 6c 65 6e 20 28 70 77 | 65 6e 74 2e 70 77 5f 61 |rlen (pw|ent.pw_a|
|00004550| 67 65 29 20 3d 3d 20 34 | 29 0a 09 09 09 09 6c 61 |ge) == 4|).....la|
|00004560| 73 74 64 61 79 20 3d 20 | 61 36 34 6c 20 28 70 77 |stday = |a64l (pw|
|00004570| 65 6e 74 2e 70 77 5f 61 | 67 65 2b 32 29 20 2a 20 |ent.pw_a|ge+2) * |
|00004580| 28 57 45 45 4b 2f 53 43 | 41 4c 45 29 3b 0a 09 09 |(WEEK/SC|ALE);...|
|00004590| 7d 20 65 6c 73 65 20 7b | 0a 09 09 09 6d 69 6e 64 |} else {|....mind|
|000045a0| 61 79 73 20 3d 20 30 3b | 0a 09 09 09 6d 61 78 64 |ays = 0;|....maxd|
|000045b0| 61 79 73 20 3d 20 31 30 | 30 30 30 4c 20 2a 20 28 |ays = 10|000L * (|
|000045c0| 44 41 59 2f 53 43 41 4c | 45 29 3b 0a 09 09 09 6c |DAY/SCAL|E);....l|
|000045d0| 61 73 74 64 61 79 20 3d | 20 2d 31 3b 0a 09 09 7d |astday =| -1;...}|
|000045e0| 0a 09 09 77 61 72 6e 64 | 61 79 73 20 3d 20 69 6e |...warnd|ays = in|
|000045f0| 61 63 74 64 61 79 73 20 | 3d 20 65 78 70 64 61 79 |actdays |= expday|
|00004600| 73 20 3d 20 2d 31 3b 0a | 09 7d 0a 23 65 6e 64 69 |s = -1;.|.}.#endi|
|00004610| 66 0a 0a 09 2f 2a 0a 09 | 20 2a 20 50 72 69 6e 74 |f.../*..| * Print|
|00004620| 20 6f 75 74 20 74 68 65 | 20 65 78 70 69 72 61 74 | out the| expirat|
|00004630| 69 6f 6e 20 66 69 65 6c | 64 73 20 69 66 20 74 68 |ion fiel|ds if th|
|00004640| 65 20 75 73 65 72 20 68 | 61 73 0a 09 20 2a 20 72 |e user h|as.. * r|
|00004650| 65 71 75 65 73 74 65 64 | 20 74 68 65 20 6c 69 73 |equested| the lis|
|00004660| 74 20 6f 70 74 69 6f 6e | 2e 0a 09 20 2a 2f 0a 0a |t option|... */..|
|00004670| 09 69 66 20 28 6c 66 6c | 67 29 20 7b 0a 09 09 69 |.if (lfl|g) {...i|
|00004680| 66 20 28 72 75 69 64 20 | 21 3d 20 30 20 26 26 20 |f (ruid |!= 0 && |
|00004690| 72 75 69 64 20 21 3d 20 | 70 77 2d 3e 70 77 5f 75 |ruid != |pw->pw_u|
|000046a0| 69 64 29 20 7b 0a 09 09 | 09 66 70 72 69 6e 74 66 |id) {...|.fprintf|
|000046b0| 20 28 73 74 64 65 72 72 | 2c 20 4e 4f 5f 50 45 52 | (stderr|, NO_PER|
|000046c0| 4d 2c 20 50 72 6f 67 29 | 3b 0a 23 69 66 64 65 66 |M, Prog)|;.#ifdef|
|000046d0| 09 55 53 45 5f 53 59 53 | 4c 4f 47 0a 09 09 09 63 |.USE_SYS|LOG....c|
|000046e0| 6c 6f 73 65 6c 6f 67 20 | 28 29 3b 0a 23 65 6e 64 |loselog |();.#end|
|000046f0| 69 66 0a 09 09 09 65 78 | 69 74 20 28 31 29 3b 0a |if....ex|it (1);.|
|00004700| 09 09 7d 0a 09 09 6c 69 | 73 74 5f 66 69 65 6c 64 |..}...li|st_field|
|00004710| 73 20 28 29 3b 0a 09 09 | 63 6c 65 61 6e 75 70 20 |s ();...|cleanup |
|00004720| 28 32 29 3b 0a 23 69 66 | 64 65 66 09 55 53 45 5f |(2);.#if|def.USE_|
|00004730| 53 59 53 4c 4f 47 0a 09 | 09 63 6c 6f 73 65 6c 6f |SYSLOG..|.closelo|
|00004740| 67 20 28 29 3b 0a 23 65 | 6e 64 69 66 0a 09 09 65 |g ();.#e|ndif...e|
|00004750| 78 69 74 20 28 30 29 3b | 0a 09 7d 0a 0a 09 2f 2a |xit (0);|..}.../*|
|00004760| 0a 09 20 2a 20 49 66 20 | 6e 6f 6e 65 20 6f 66 20 |.. * If |none of |
|00004770| 74 68 65 20 66 69 65 6c | 64 73 20 77 65 72 65 20 |the fiel|ds were |
|00004780| 63 68 61 6e 67 65 64 20 | 66 72 6f 6d 20 74 68 65 |changed |from the|
|00004790| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 2c 0a 09 | command| line,..|
|000047a0| 20 2a 20 6c 65 74 20 74 | 68 65 20 75 73 65 72 20 | * let t|he user |
|000047b0| 69 6e 74 65 72 61 63 74 | 69 76 65 6c 79 20 63 68 |interact|ively ch|
|000047c0| 61 6e 67 65 20 74 68 65 | 6d 2e 0a 09 20 2a 2f 0a |ange the|m... */.|
|000047d0| 0a 09 69 66 20 28 21 20 | 6d 66 6c 67 20 26 26 20 |..if (! |mflg && |
|000047e0| 21 20 4d 66 6c 67 20 26 | 26 20 21 20 64 66 6c 67 |! Mflg &|& ! dflg|
|000047f0| 20 26 26 20 21 20 57 66 | 6c 67 20 26 26 20 21 20 | && ! Wf|lg && ! |
|00004800| 49 66 6c 67 20 26 26 20 | 21 20 45 66 6c 67 29 20 |Iflg && |! Eflg) |
|00004810| 7b 0a 09 09 70 72 69 6e | 74 66 20 28 43 48 41 4e |{...prin|tf (CHAN|
|00004820| 47 45 5f 49 4e 46 4f 2c | 20 6e 61 6d 65 29 3b 0a |GE_INFO,| name);.|
|00004830| 09 09 69 66 20 28 21 20 | 6e 65 77 5f 66 69 65 6c |..if (! |new_fiel|
|00004840| 64 73 20 28 29 29 20 7b | 0a 09 09 09 66 70 72 69 |ds ()) {|....fpri|
|00004850| 6e 74 66 20 28 73 74 64 | 65 72 72 2c 20 46 49 45 |ntf (std|err, FIE|
|00004860| 4c 44 5f 45 52 52 2c 20 | 50 72 6f 67 29 3b 0a 09 |LD_ERR, |Prog);..|
|00004870| 09 09 63 6c 65 61 6e 75 | 70 20 28 32 29 3b 0a 23 |..cleanu|p (2);.#|
|00004880| 69 66 64 65 66 09 55 53 | 45 5f 53 59 53 4c 4f 47 |ifdef.US|E_SYSLOG|
|00004890| 0a 09 09 09 63 6c 6f 73 | 65 6c 6f 67 20 28 29 3b |....clos|elog ();|
|000048a0| 0a 23 65 6e 64 69 66 0a | 09 09 09 65 78 69 74 20 |.#endif.|...exit |
|000048b0| 28 31 29 3b 0a 09 09 7d | 0a 09 7d 0a 0a 09 2f 2a |(1);...}|..}.../*|
|000048c0| 0a 09 20 2a 20 54 68 65 | 72 65 20 77 61 73 20 6e |.. * The|re was n|
|000048d0| 6f 20 73 68 61 64 6f 77 | 20 65 6e 74 72 79 2e 20 |o shadow| entry. |
|000048e0| 20 54 68 65 20 6e 65 77 | 20 65 6e 74 72 79 20 77 | The new| entry w|
|000048f0| 69 6c 6c 20 68 61 76 65 | 20 74 68 65 0a 09 20 2a |ill have| the.. *|
|00004900| 20 65 6e 63 72 79 70 74 | 65 64 20 70 61 73 73 77 | encrypt|ed passw|
|00004910| 6f 72 64 20 74 72 61 6e | 73 66 65 72 72 65 64 20 |ord tran|sferred |
|00004920| 66 72 6f 6d 20 74 68 65 | 20 6e 6f 72 6d 61 6c 20 |from the| normal |
|00004930| 70 61 73 73 77 6f 72 64 | 0a 09 20 2a 20 66 69 6c |password|.. * fil|
|00004940| 65 20 61 6c 6f 6e 67 20 | 77 69 74 68 20 74 68 65 |e along |with the|
|00004950| 20 61 67 69 6e 67 20 69 | 6e 66 6f 72 6d 61 74 69 | aging i|nformati|
|00004960| 6f 6e 2e 0a 09 20 2a 2f | 0a 0a 09 69 66 20 28 73 |on... */|...if (s|
|00004970| 70 20 3d 3d 20 30 29 20 | 7b 0a 09 09 73 70 20 3d |p == 0) |{...sp =|
|00004980| 20 26 73 70 77 64 3b 0a | 09 09 62 7a 65 72 6f 20 | &spwd;.|..bzero |
|00004990| 28 26 73 70 77 64 2c 20 | 73 69 7a 65 6f 66 20 73 |(&spwd, |sizeof s|
|000049a0| 70 77 64 29 3b 0a 0a 09 | 09 73 70 2d 3e 73 70 5f |pwd);...|.sp->sp_|
|000049b0| 6e 61 6d 70 20 3d 20 70 | 77 2d 3e 70 77 5f 6e 61 |namp = p|w->pw_na|
|000049c0| 6d 65 3b 0a 09 09 73 70 | 2d 3e 73 70 5f 70 77 64 |me;...sp|->sp_pwd|
|000049d0| 70 20 3d 20 70 77 2d 3e | 70 77 5f 70 61 73 73 77 |p = pw->|pw_passw|
|000049e0| 64 3b 0a 09 09 73 70 2d | 3e 73 70 5f 66 6c 61 67 |d;...sp-|>sp_flag|
|000049f0| 20 3d 20 2d 31 3b 0a 0a | 09 09 70 77 65 6e 74 2e | = -1;..|..pwent.|
|00004a00| 70 77 5f 70 61 73 73 77 | 64 20 3d 20 22 21 22 3b |pw_passw|d = "!";|
|00004a10| 0a 23 69 66 64 65 66 09 | 41 54 54 5f 41 47 45 0a |.#ifdef.|ATT_AGE.|
|00004a20| 09 09 70 77 65 6e 74 2e | 70 77 5f 61 67 65 20 3d |..pwent.|pw_age =|
|00004a30| 20 22 22 3b 0a 23 65 6e | 64 69 66 0a 09 09 69 66 | "";.#en|dif...if|
|00004a40| 20 28 21 20 70 77 5f 75 | 70 64 61 74 65 20 28 26 | (! pw_u|pdate (&|
|00004a50| 70 77 65 6e 74 29 29 20 | 7b 0a 09 09 09 66 70 72 |pwent)) |{....fpr|
|00004a60| 69 6e 74 66 20 28 73 74 | 64 65 72 72 2c 20 4e 4f |intf (st|derr, NO|
|00004a70| 5f 50 57 55 50 44 41 54 | 45 2c 20 50 72 6f 67 29 |_PWUPDAT|E, Prog)|
|00004a80| 3b 0a 09 09 09 63 6c 65 | 61 6e 75 70 20 28 32 29 |;....cle|anup (2)|
|00004a90| 3b 0a 23 69 66 64 65 66 | 09 55 53 45 5f 53 59 53 |;.#ifdef|.USE_SYS|
|00004aa0| 4c 4f 47 0a 09 09 09 73 | 79 73 6c 6f 67 20 28 4c |LOG....s|yslog (L|
|00004ab0| 4f 47 5f 45 52 52 2c 20 | 57 52 49 54 45 5f 46 41 |OG_ERR, |WRITE_FA|
|00004ac0| 49 4c 2c 20 22 2f 65 74 | 63 2f 70 61 73 73 77 64 |IL, "/et|c/passwd|
|00004ad0| 22 29 3b 0a 09 09 09 63 | 6c 6f 73 65 6c 6f 67 20 |");....c|loselog |
|00004ae0| 28 29 3b 0a 23 65 6e 64 | 69 66 0a 09 09 09 65 78 |();.#end|if....ex|
|00004af0| 69 74 20 28 31 29 3b 0a | 09 09 7d 0a 23 69 66 20 |it (1);.|..}.#if |
|00004b00| 64 65 66 69 6e 65 64 28 | 44 42 4d 29 20 7c 7c 20 |defined(|DBM) || |
|00004b10| 64 65 66 69 6e 65 64 28 | 4e 44 42 4d 29 0a 09 09 |defined(|NDBM)...|
|00004b20| 28 76 6f 69 64 29 20 70 | 77 5f 64 62 6d 5f 75 70 |(void) p|w_dbm_up|
|00004b30| 64 61 74 65 20 28 26 70 | 77 65 6e 74 29 3b 0a 09 |date (&p|went);..|
|00004b40| 09 65 6e 64 70 77 65 6e | 74 20 28 29 3b 0a 23 65 |.endpwen|t ();.#e|
|00004b50| 6e 64 69 66 0a 09 7d 0a | 0a 09 2f 2a 0a 09 20 2a |ndif..}.|../*.. *|
|00004b60| 20 43 6f 70 79 20 74 68 | 65 20 66 69 65 6c 64 73 | Copy th|e fields|
|00004b70| 20 62 61 63 6b 20 74 6f | 20 74 68 65 20 73 68 61 | back to| the sha|
|00004b80| 64 6f 77 20 66 69 6c 65 | 20 65 6e 74 72 79 20 61 |dow file| entry a|
|00004b90| 6e 64 0a 09 20 2a 20 77 | 72 69 74 65 20 74 68 65 |nd.. * w|rite the|
|00004ba0| 20 6d 6f 64 69 66 69 65 | 64 20 65 6e 74 72 79 20 | modifie|d entry |
|00004bb0| 62 61 63 6b 20 74 6f 20 | 74 68 65 20 73 68 61 64 |back to |the shad|
|00004bc0| 6f 77 20 66 69 6c 65 2e | 0a 09 20 2a 20 43 6c 6f |ow file.|.. * Clo|
|00004bd0| 73 69 6e 67 20 74 68 65 | 20 73 68 61 64 6f 77 20 |sing the| shadow |
|00004be0| 61 6e 64 20 70 61 73 73 | 77 6f 72 64 20 66 69 6c |and pass|word fil|
|00004bf0| 65 73 20 77 69 6c 6c 20 | 63 6f 6d 6d 69 74 0a 09 |es will |commit..|
|00004c00| 20 2a 20 61 6e 79 20 63 | 68 61 6e 67 65 73 20 74 | * any c|hanges t|
|00004c10| 68 61 74 20 68 61 76 65 | 20 62 65 65 6e 20 6d 61 |hat have| been ma|
|00004c20| 64 65 2e 0a 09 20 2a 2f | 0a 0a 09 73 70 2d 3e 73 |de... */|...sp->s|
|00004c30| 70 5f 6d 61 78 20 3d 20 | 6d 61 78 64 61 79 73 3b |p_max = |maxdays;|
|00004c40| 0a 09 73 70 2d 3e 73 70 | 5f 6d 69 6e 20 3d 20 6d |..sp->sp|_min = m|
|00004c50| 69 6e 64 61 79 73 3b 0a | 09 73 70 2d 3e 73 70 5f |indays;.|.sp->sp_|
|00004c60| 6c 73 74 63 68 67 20 3d | 20 6c 61 73 74 64 61 79 |lstchg =| lastday|
|00004c70| 3b 0a 09 73 70 2d 3e 73 | 70 5f 77 61 72 6e 20 3d |;..sp->s|p_warn =|
|00004c80| 20 77 61 72 6e 64 61 79 | 73 3b 0a 09 73 70 2d 3e | warnday|s;..sp->|
|00004c90| 73 70 5f 69 6e 61 63 74 | 20 3d 20 69 6e 61 63 74 |sp_inact| = inact|
|00004ca0| 64 61 79 73 3b 0a 09 73 | 70 2d 3e 73 70 5f 65 78 |days;..s|p->sp_ex|
|00004cb0| 70 69 72 65 20 3d 20 65 | 78 70 64 61 79 73 3b 0a |pire = e|xpdays;.|
|00004cc0| 0a 09 69 66 20 28 21 20 | 73 70 77 5f 75 70 64 61 |..if (! |spw_upda|
|00004cd0| 74 65 20 28 73 70 29 29 | 20 7b 0a 09 09 66 70 72 |te (sp))| {...fpr|
|00004ce0| 69 6e 74 66 20 28 73 74 | 64 65 72 72 2c 20 4e 4f |intf (st|derr, NO|
|00004cf0| 5f 53 50 55 50 44 41 54 | 45 2c 20 50 72 6f 67 29 |_SPUPDAT|E, Prog)|
|00004d00| 3b 0a 09 09 63 6c 65 61 | 6e 75 70 20 28 32 29 3b |;...clea|nup (2);|
|00004d10| 0a 23 69 66 64 65 66 09 | 55 53 45 5f 53 59 53 4c |.#ifdef.|USE_SYSL|
|00004d20| 4f 47 0a 09 09 73 79 73 | 6c 6f 67 20 28 4c 4f 47 |OG...sys|log (LOG|
|00004d30| 5f 45 52 52 2c 20 57 52 | 49 54 45 5f 46 41 49 4c |_ERR, WR|ITE_FAIL|
|00004d40| 2c 20 22 2f 65 74 63 2f | 73 68 61 64 6f 77 22 29 |, "/etc/|shadow")|
|00004d50| 3b 0a 09 09 63 6c 6f 73 | 65 6c 6f 67 20 28 29 3b |;...clos|elog ();|
|00004d60| 0a 23 65 6e 64 69 66 0a | 09 09 65 78 69 74 20 28 |.#endif.|..exit (|
|00004d70| 31 29 3b 0a 09 7d 0a 23 | 69 66 64 65 66 09 4e 44 |1);..}.#|ifdef.ND|
|00004d80| 42 4d 0a 0a 09 2f 2a 0a | 09 20 2a 20 53 65 65 20 |BM.../*.|. * See |
|00004d90| 69 66 20 74 68 65 20 73 | 68 61 64 6f 77 20 44 42 |if the s|hadow DB|
|00004da0| 4d 20 66 69 6c 65 20 65 | 78 69 73 74 73 20 61 6e |M file e|xists an|
|00004db0| 64 20 74 72 79 20 74 6f | 20 75 70 64 61 74 65 20 |d try to| update |
|00004dc0| 69 74 2e 0a 09 20 2a 2f | 0a 0a 09 69 66 20 28 61 |it... */|...if (a|
|00004dd0| 63 63 65 73 73 20 28 22 | 2f 65 74 63 2f 73 68 61 |ccess ("|/etc/sha|
|00004de0| 64 6f 77 2e 70 61 67 22 | 2c 20 30 29 20 3d 3d 20 |dow.pag"|, 0) == |
|00004df0| 30 20 26 26 20 21 20 73 | 70 5f 64 62 6d 5f 75 70 |0 && ! s|p_dbm_up|
|00004e00| 64 61 74 65 20 28 73 70 | 29 29 20 7b 0a 09 09 66 |date (sp|)) {...f|
|00004e10| 70 72 69 6e 74 66 20 28 | 73 74 64 65 72 72 2c 20 |printf (|stderr, |
|00004e20| 44 42 4d 45 52 52 4f 52 | 29 3b 0a 09 09 63 6c 65 |DBMERROR|);...cle|
|00004e30| 61 6e 75 70 20 28 32 29 | 3b 0a 23 69 66 64 65 66 |anup (2)|;.#ifdef|
|00004e40| 09 55 53 45 5f 53 59 53 | 4c 4f 47 0a 09 09 73 79 |.USE_SYS|LOG...sy|
|00004e50| 73 6c 6f 67 20 28 4c 4f | 47 5f 45 52 52 2c 20 44 |slog (LO|G_ERR, D|
|00004e60| 42 4d 45 52 52 4f 52 32 | 29 3b 0a 09 09 63 6c 6f |BMERROR2|);...clo|
|00004e70| 73 65 6c 6f 67 20 28 29 | 3b 0a 23 65 6e 64 69 66 |selog ()|;.#endif|
|00004e80| 0a 09 09 65 78 69 74 20 | 28 31 29 3b 0a 09 7d 0a |...exit |(1);..}.|
|00004e90| 09 65 6e 64 73 70 65 6e | 74 20 28 29 3b 0a 23 65 |.endspen|t ();.#e|
|00004ea0| 6e 64 69 66 09 2f 2a 20 | 4e 44 42 4d 20 2a 2f 0a |ndif./* |NDBM */.|
|00004eb0| 0a 09 2f 2a 0a 09 20 2a | 20 4e 6f 77 20 63 6c 6f |../*.. *| Now clo|
|00004ec0| 73 65 20 74 68 65 20 73 | 68 61 64 6f 77 20 70 61 |se the s|hadow pa|
|00004ed0| 73 73 77 6f 72 64 20 66 | 69 6c 65 2c 20 77 68 69 |ssword f|ile, whi|
|00004ee0| 63 68 20 77 69 6c 6c 20 | 63 61 75 73 65 20 61 6c |ch will |cause al|
|00004ef0| 6c 0a 09 20 2a 20 6f 66 | 20 74 68 65 20 65 6e 74 |l.. * of| the ent|
|00004f00| 72 69 65 73 20 74 6f 20 | 62 65 20 72 65 2d 77 72 |ries to |be re-wr|
|00004f10| 69 74 74 65 6e 2e 0a 09 | 20 2a 2f 0a 0a 09 69 66 |itten...| */...if|
|00004f20| 20 28 21 20 73 70 77 5f | 63 6c 6f 73 65 20 28 29 | (! spw_|close ()|
|00004f30| 29 20 7b 0a 09 09 66 70 | 72 69 6e 74 66 20 28 73 |) {...fp|rintf (s|
|00004f40| 74 64 65 72 72 2c 20 4e | 4f 5f 53 50 43 4c 4f 53 |tderr, N|O_SPCLOS|
|00004f50| 45 2c 20 50 72 6f 67 29 | 3b 0a 09 09 63 6c 65 61 |E, Prog)|;...clea|
|00004f60| 6e 75 70 20 28 32 29 3b | 0a 23 69 66 64 65 66 09 |nup (2);|.#ifdef.|
|00004f70| 55 53 45 5f 53 59 53 4c | 4f 47 0a 09 09 73 79 73 |USE_SYSL|OG...sys|
|00004f80| 6c 6f 67 20 28 4c 4f 47 | 5f 45 52 52 2c 20 43 4c |log (LOG|_ERR, CL|
|00004f90| 4f 53 45 5f 46 41 49 4c | 2c 20 22 2f 65 74 63 2f |OSE_FAIL|, "/etc/|
|00004fa0| 73 68 61 64 6f 77 22 29 | 3b 0a 09 09 63 6c 6f 73 |shadow")|;...clos|
|00004fb0| 65 6c 6f 67 20 28 29 3b | 0a 23 65 6e 64 69 66 0a |elog ();|.#endif.|
|00004fc0| 09 09 65 78 69 74 20 28 | 31 29 3b 0a 09 7d 0a 0a |..exit (|1);..}..|
|00004fd0| 09 2f 2a 0a 09 20 2a 20 | 43 6c 6f 73 65 20 74 68 |./*.. * |Close th|
|00004fe0| 65 20 70 61 73 73 77 6f | 72 64 20 66 69 6c 65 2e |e passwo|rd file.|
|00004ff0| 20 20 49 66 20 61 6e 79 | 20 65 6e 74 72 69 65 73 | If any| entries|
|00005000| 20 77 65 72 65 20 6d 6f | 64 69 66 69 65 64 2c 20 | were mo|dified, |
|00005010| 74 68 65 0a 09 20 2a 20 | 66 69 6c 65 20 77 69 6c |the.. * |file wil|
|00005020| 6c 20 62 65 20 72 65 2d | 77 72 69 74 74 65 6e 2e |l be re-|written.|
|00005030| 0a 09 20 2a 2f 0a 0a 09 | 69 66 20 28 21 20 70 77 |.. */...|if (! pw|
|00005040| 5f 63 6c 6f 73 65 20 28 | 29 29 20 7b 0a 09 09 66 |_close (|)) {...f|
|00005050| 70 72 69 6e 74 66 20 28 | 73 74 64 65 72 72 2c 20 |printf (|stderr, |
|00005060| 4e 4f 5f 50 57 43 4c 4f | 53 45 2c 20 50 72 6f 67 |NO_PWCLO|SE, Prog|
|00005070| 29 3b 0a 09 09 63 6c 65 | 61 6e 75 70 20 28 32 29 |);...cle|anup (2)|
|00005080| 3b 0a 23 69 66 64 65 66 | 09 55 53 45 5f 53 59 53 |;.#ifdef|.USE_SYS|
|00005090| 4c 4f 47 0a 09 09 73 79 | 73 6c 6f 67 20 28 4c 4f |LOG...sy|slog (LO|
|000050a0| 47 5f 45 52 52 2c 20 43 | 4c 4f 53 45 5f 46 41 49 |G_ERR, C|LOSE_FAI|
|000050b0| 4c 2c 20 22 2f 65 74 63 | 2f 70 61 73 73 77 64 22 |L, "/etc|/passwd"|
|000050c0| 29 3b 0a 09 09 63 6c 6f | 73 65 6c 6f 67 20 28 29 |);...clo|selog ()|
|000050d0| 3b 0a 23 65 6e 64 69 66 | 0a 09 09 65 78 69 74 20 |;.#endif|...exit |
|000050e0| 28 31 29 3b 0a 09 7d 0a | 09 63 6c 65 61 6e 75 70 |(1);..}.|.cleanup|
|000050f0| 20 28 32 29 3b 0a 23 69 | 66 64 65 66 09 55 53 45 | (2);.#i|fdef.USE|
|00005100| 5f 53 59 53 4c 4f 47 0a | 09 63 6c 6f 73 65 6c 6f |_SYSLOG.|.closelo|
|00005110| 67 20 28 29 3b 0a 23 65 | 6e 64 69 66 0a 09 65 78 |g ();.#e|ndif..ex|
|00005120| 69 74 20 28 30 29 3b 0a | 09 2f 2a 4e 4f 54 52 45 |it (0);.|./*NOTRE|
|00005130| 41 43 48 45 44 2a 2f 0a | 7d 0a 0a 2f 2a 0a 20 2a |ACHED*/.|}../*. *|
|00005140| 20 63 6c 65 61 6e 75 70 | 20 2d 20 75 6e 6c 6f 63 | cleanup| - unloc|
|00005150| 6b 20 61 6e 79 20 6c 6f | 63 6b 65 64 20 70 61 73 |k any lo|cked pas|
|00005160| 73 77 6f 72 64 20 66 69 | 6c 65 73 0a 20 2a 2f 0a |sword fi|les. */.|
|00005170| 0a 76 6f 69 64 0a 63 6c | 65 61 6e 75 70 20 28 73 |.void.cl|eanup (s|
|00005180| 74 61 74 65 29 0a 69 6e | 74 09 73 74 61 74 65 3b |tate).in|t.state;|
|00005190| 0a 7b 0a 09 73 77 69 74 | 63 68 20 28 73 74 61 74 |.{..swit|ch (stat|
|000051a0| 65 29 20 7b 0a 09 09 63 | 61 73 65 20 32 3a 0a 09 |e) {...c|ase 2:..|
|000051b0| 09 09 73 70 77 5f 75 6e | 6c 6f 63 6b 20 28 29 3b |..spw_un|lock ();|
|000051c0| 0a 09 09 63 61 73 65 20 | 31 3a 0a 09 09 09 70 77 |...case |1:....pw|
|000051d0| 5f 75 6e 6c 6f 63 6b 20 | 28 29 3b 0a 09 09 63 61 |_unlock |();...ca|
|000051e0| 73 65 20 30 3a 0a 09 09 | 09 62 72 65 61 6b 3b 0a |se 0:...|.break;.|
|000051f0| 09 7d 0a 7d 0a 00 00 00 | 00 00 00 00 00 00 00 00 |.}.}....|........|
|00005200| 73 68 61 64 6f 77 2d 33 | 2e 31 2e 34 2f 63 68 66 |shadow-3|.1.4/chf|
|00005210| 6e 2e 31 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |n.1.....|........|
|00005220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00005270| 34 34 20 00 20 20 20 33 | 31 30 20 00 20 20 20 20 |44 . 3|10 . |
|00005280| 20 20 20 33 30 37 36 20 | 20 35 31 31 34 35 37 34 | 3076 | 5114574|
|00005290| 33 34 34 20 20 31 33 33 | 30 36 00 20 30 00 00 00 |344 133|06. 0...|
|000052a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005300| 00 75 73 74 61 72 20 20 | 00 62 72 65 6e 64 61 6e |.ustar |.brendan|
|00005310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005320| 00 00 00 00 00 00 00 00 | 00 73 79 73 74 65 6d 73 |........|.systems|
|00005330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005400| 2e 5c 22 20 43 6f 70 79 | 72 69 67 68 74 20 31 39 |.\" Copy|right 19|
|00005410| 39 30 2c 20 4a 6f 68 6e | 20 46 2e 20 48 61 75 67 |90, John| F. Haug|
|00005420| 68 20 49 49 0a 2e 5c 22 | 20 41 6c 6c 20 72 69 67 |h II..\"| All rig|
|00005430| 68 74 73 20 72 65 73 65 | 72 76 65 64 2e 0a 2e 5c |hts rese|rved...\|
|00005440| 22 0a 2e 5c 22 20 55 73 | 65 2c 20 64 75 70 6c 69 |"..\" Us|e, dupli|
|00005450| 63 61 74 69 6f 6e 2c 20 | 61 6e 64 20 64 69 73 63 |cation, |and disc|
|00005460| 6c 6f 73 75 72 65 20 70 | 72 6f 68 69 62 69 74 65 |losure p|rohibite|
|00005470| 64 20 77 69 74 68 6f 75 | 74 0a 2e 5c 22 20 74 68 |d withou|t..\" th|
|00005480| 65 20 65 78 70 72 65 73 | 73 20 77 72 69 74 74 65 |e expres|s writte|
|00005490| 6e 20 70 65 72 6d 69 73 | 73 69 6f 6e 20 6f 66 20 |n permis|sion of |
|000054a0| 74 68 65 20 61 75 74 68 | 6f 72 2e 0a 2e 5c 22 0a |the auth|or...\".|
|000054b0| 2e 5c 22 09 40 28 23 29 | 63 68 66 6e 2e 31 09 33 |.\".@(#)|chfn.1.3|
|000054c0| 2e 31 09 30 39 3a 33 34 | 3a 31 36 09 31 31 2f 32 |.1.09:34|:16.11/2|
|000054d0| 31 2f 39 30 0a 2e 5c 22 | 0a 2e 54 48 20 43 48 46 |1/90..\"|..TH CHF|
|000054e0| 4e 20 31 0a 2e 53 48 20 | 4e 41 4d 45 0a 63 68 66 |N 1..SH |NAME.chf|
|000054f0| 6e 20 5c 2d 20 63 68 61 | 6e 67 65 20 75 73 65 72 |n \- cha|nge user|
|00005500| 20 6e 61 6d 65 20 61 6e | 64 20 69 6e 66 6f 72 6d | name an|d inform|
|00005510| 61 74 69 6f 6e 0a 2e 53 | 48 20 53 59 4e 4f 50 53 |ation..S|H SYNOPS|
|00005520| 49 53 0a 5c 66 42 63 68 | 66 6e 5c 66 52 20 5b 20 |IS.\fBch|fn\fR [ |
|00005530| 5c 66 42 2d 66 20 5c 66 | 49 66 75 6c 6c 5f 6e 61 |\fB-f \f|Ifull_na|
|00005540| 6d 65 5c 66 52 20 5d 20 | 5b 20 5c 66 42 2d 72 20 |me\fR ] |[ \fB-r |
|00005550| 5c 66 49 72 6f 6f 6d 5f | 6e 6f 5c 66 52 20 5d 0a |\fIroom_|no\fR ].|
|00005560| 2e 62 72 0a 5b 20 5c 66 | 42 2d 77 20 5c 66 49 77 |.br.[ \f|B-w \fIw|
|00005570| 6f 72 6b 5f 70 68 5c 66 | 52 20 5d 20 5b 20 5c 66 |ork_ph\f|R ] [ \f|
|00005580| 42 2d 68 20 5c 66 49 68 | 6f 6d 65 5f 70 68 5c 66 |B-h \fIh|ome_ph\f|
|00005590| 52 20 5d 20 5b 20 5c 66 | 42 2d 6f 20 5c 66 49 6f |R ] [ \f|B-o \fIo|
|000055a0| 74 68 65 72 5c 66 52 20 | 5d 0a 5b 20 5c 66 49 75 |ther\fR |].[ \fIu|
|000055b0| 73 65 72 5c 66 52 20 5d | 0a 2e 53 48 20 44 45 53 |ser\fR ]|..SH DES|
|000055c0| 43 52 49 50 54 49 4f 4e | 0a 5c 66 49 63 68 66 6e |CRIPTION|.\fIchfn|
|000055d0| 5c 66 20 63 68 61 6e 67 | 65 73 20 75 73 65 72 20 |\f chang|es user |
|000055e0| 66 75 6c 6c 6e 61 6d 65 | 2c 20 6f 66 66 69 63 65 |fullname|, office|
|000055f0| 20 6e 75 6d 62 65 72 2c | 20 6f 66 66 69 63 65 20 | number,| office |
|00005600| 65 78 74 65 6e 73 69 6f | 6e 2c 20 61 6e 64 20 68 |extensio|n, and h|
|00005610| 6f 6d 65 0a 70 68 6f 6e | 65 20 6e 75 6d 62 65 72 |ome.phon|e number|
|00005620| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 66 6f 72 | informa|tion for|
|00005630| 20 61 20 75 73 65 72 27 | 73 20 61 63 63 6f 75 6e | a user'|s accoun|
|00005640| 74 2e 20 0a 54 68 69 73 | 20 69 6e 66 6f 72 6d 61 |t. .This| informa|
|00005650| 74 69 6f 6e 20 69 73 20 | 74 79 70 69 63 61 6c 6c |tion is |typicall|
|00005660| 79 20 70 72 69 6e 74 65 | 64 20 62 79 20 5c 66 49 |y printe|d by \fI|
|00005670| 66 69 6e 67 65 72 28 31 | 29 5c 66 20 61 6e 64 20 |finger(1|)\f and |
|00005680| 73 69 6d 69 6c 69 61 72 | 0a 70 72 6f 67 72 61 6d |similiar|.program|
|00005690| 73 2e 0a 41 20 6e 6f 72 | 6d 61 6c 20 75 73 65 72 |s..A nor|mal user|
|000056a0| 20 6d 61 79 20 6f 6e 6c | 79 20 63 68 61 6e 67 65 | may onl|y change|
|000056b0| 20 74 68 65 20 66 69 65 | 6c 64 73 20 66 6f 72 20 | the fie|lds for |
|000056c0| 74 68 65 69 72 20 6f 77 | 6e 20 61 63 63 6f 75 6e |their ow|n accoun|
|000056d0| 74 2c 0a 74 68 65 20 73 | 75 70 65 72 20 75 73 65 |t,.the s|uper use|
|000056e0| 72 20 6d 61 79 20 63 68 | 61 6e 67 65 20 74 68 65 |r may ch|ange the|
|000056f0| 20 66 69 65 6c 64 73 20 | 66 6f 72 20 61 6e 79 20 | fields |for any |
|00005700| 61 63 63 6f 75 6e 74 2e | 0a 41 6c 73 6f 2c 20 6f |account.|.Also, o|
|00005710| 6e 6c 79 20 74 68 65 20 | 73 75 70 65 72 20 75 73 |nly the |super us|
|00005720| 65 72 20 6d 61 79 20 75 | 73 65 20 74 68 65 20 5c |er may u|se the \|
|00005730| 66 42 2d 6f 5c 66 20 6f | 70 74 69 6f 6e 20 74 6f |fB-o\f o|ption to|
|00005740| 20 63 68 61 6e 67 65 20 | 74 68 65 0a 75 6e 64 65 | change |the.unde|
|00005750| 66 69 6e 65 64 20 70 6f | 72 74 69 6f 6e 73 20 6f |fined po|rtions o|
|00005760| 66 20 74 68 65 20 47 43 | 4f 53 20 66 69 65 6c 64 |f the GC|OS field|
|00005770| 2e 0a 2e 50 50 0a 54 68 | 65 20 6f 6e 6c 79 20 72 |...PP.Th|e only r|
|00005780| 65 73 74 72 69 63 74 69 | 6f 6e 73 20 70 6c 61 63 |estricti|ons plac|
|00005790| 65 64 20 6f 6e 20 74 68 | 65 20 63 6f 6e 74 65 6e |ed on th|e conten|
|000057a0| 74 73 20 6f 66 20 74 68 | 65 20 66 69 65 6c 64 73 |ts of th|e fields|
|000057b0| 20 69 73 20 74 68 61 74 | 20 6e 6f 0a 63 6f 6e 74 | is that| no.cont|
|000057c0| 72 6f 6c 20 63 68 61 72 | 61 63 74 65 72 73 20 6d |rol char|acters m|
|000057d0| 61 79 20 62 65 20 70 72 | 65 73 65 6e 74 2c 20 6e |ay be pr|esent, n|
|000057e0| 6f 72 20 61 6e 79 20 6f | 66 20 63 6f 6d 6d 61 2c |or any o|f comma,|
|000057f0| 20 63 6f 6c 6f 6e 2c 20 | 6f 72 20 65 71 75 61 6c | colon, |or equal|
|00005800| 20 73 69 67 6e 2e 0a 54 | 68 65 20 5c 66 49 6f 74 | sign..T|he \fIot|
|00005810| 68 65 72 5c 66 20 66 69 | 65 6c 64 20 64 6f 65 73 |her\f fi|eld does|
|00005820| 20 6e 6f 74 20 68 61 76 | 65 20 74 68 69 73 20 72 | not hav|e this r|
|00005830| 65 73 74 72 69 63 74 69 | 6f 6e 2c 20 61 6e 64 20 |estricti|on, and |
|00005840| 69 73 20 75 73 65 64 20 | 74 6f 0a 73 74 6f 72 65 |is used |to.store|
|00005850| 20 61 63 63 6f 75 6e 74 | 69 6e 67 20 69 6e 66 6f | account|ing info|
|00005860| 72 6d 61 74 69 6f 6e 20 | 75 73 65 64 20 62 79 20 |rmation |used by |
|00005870| 6f 74 68 65 72 20 61 70 | 70 6c 69 63 61 74 69 6f |other ap|plicatio|
|00005880| 6e 73 2e 0a 2e 50 50 0a | 49 66 20 6e 6f 6e 65 20 |ns...PP.|If none |
|00005890| 6f 66 20 74 68 65 20 6f | 70 74 69 6f 6e 73 20 61 |of the o|ptions a|
|000058a0| 72 65 20 73 65 6c 65 63 | 74 65 64 2c 20 5c 66 49 |re selec|ted, \fI|
|000058b0| 63 68 66 6e 5c 66 20 6f | 70 65 72 61 74 65 73 20 |chfn\f o|perates |
|000058c0| 69 6e 20 61 6e 20 69 6e | 74 65 72 61 63 74 69 76 |in an in|teractiv|
|000058d0| 65 0a 66 61 73 68 69 6f | 6e 2c 20 70 72 6f 6d 70 |e.fashio|n, promp|
|000058e0| 74 69 6e 67 20 74 68 65 | 20 75 73 65 72 20 77 69 |ting the| user wi|
|000058f0| 74 68 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 76 |th the c|urrent v|
|00005900| 61 6c 75 65 73 20 66 6f | 72 20 61 6c 6c 20 6f 66 |alues fo|r all of|
|00005910| 20 74 68 65 20 66 69 65 | 6c 64 73 2e 0a 45 6e 74 | the fie|lds..Ent|
|00005920| 65 72 20 74 68 65 20 6e | 65 77 20 76 61 6c 75 65 |er the n|ew value|
|00005930| 20 74 6f 20 63 68 61 6e | 67 65 20 74 68 65 20 66 | to chan|ge the f|
|00005940| 69 65 6c 64 2c 20 6f 72 | 20 6c 65 61 76 65 20 74 |ield, or| leave t|
|00005950| 68 65 20 6c 69 6e 65 20 | 62 6c 61 6e 6b 20 74 6f |he line |blank to|
|00005960| 20 75 73 65 0a 74 68 65 | 20 63 75 72 72 65 6e 74 | use.the| current|
|00005970| 20 76 61 6c 75 65 2e 0a | 54 68 65 20 63 75 72 72 | value..|The curr|
|00005980| 65 6e 74 20 76 61 6c 75 | 65 20 69 73 20 64 69 73 |ent valu|e is dis|
|00005990| 70 6c 61 79 65 64 20 62 | 65 74 77 65 65 6e 20 61 |played b|etween a|
|000059a0| 20 70 61 69 72 20 6f 66 | 20 5c 66 42 5b 20 5d 5c | pair of| \fB[ ]\|
|000059b0| 66 20 6d 61 72 6b 73 2e | 0a 57 69 74 68 6f 75 74 |f marks.|.Without|
|000059c0| 20 6f 70 74 69 6f 6e 73 | 2c 20 63 68 66 6e 20 70 | options|, chfn p|
|000059d0| 72 6f 6d 70 74 73 20 66 | 6f 72 20 74 68 65 20 63 |rompts f|or the c|
|000059e0| 75 72 72 65 6e 74 20 75 | 73 65 72 20 61 63 63 6f |urrent u|ser acco|
|000059f0| 75 6e 74 2e 0a 2e 53 48 | 20 46 69 6c 65 73 0a 2f |unt...SH| Files./|
|00005a00| 65 74 63 2f 70 61 73 73 | 77 64 20 5c 2d 20 75 73 |etc/pass|wd \- us|
|00005a10| 65 72 20 61 63 63 6f 75 | 6e 74 20 69 6e 66 6f 72 |er accou|nt infor|
|00005a20| 6d 61 74 69 6f 6e 0a 2e | 53 48 20 53 65 65 20 41 |mation..|SH See A|
|00005a30| 6c 73 6f 0a 70 61 73 73 | 77 64 28 34 29 0a 00 00 |lso.pass|wd(4)...|
|00005a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c00| 73 68 61 64 6f 77 2d 33 | 2e 31 2e 34 2f 63 68 66 |shadow-3|.1.4/chf|
|00005c10| 6e 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |n.c.....|........|
|00005c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00005c70| 34 34 20 00 20 20 20 33 | 31 30 20 00 20 20 20 20 |44 . 3|10 . |
|00005c80| 20 20 33 30 35 35 32 20 | 20 35 31 35 33 35 32 33 | 30552 | 5153523|
|00005c90| 36 36 33 20 20 31 33 34 | 31 30 00 20 30 00 00 00 |663 134|10. 0...|
|00005ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d00| 00 75 73 74 61 72 20 20 | 00 62 72 65 6e 64 61 6e |.ustar |.brendan|
|00005d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d20| 00 00 00 00 00 00 00 00 | 00 73 79 73 74 65 6d 73 |........|.systems|
|00005d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e00| 2f 2a 0a 20 2a 20 43 6f | 70 79 72 69 67 68 74 20 |/*. * Co|pyright |
|00005e10| 31 39 38 39 2c 20 31 39 | 39 30 2c 20 31 39 39 31 |1989, 19|90, 1991|
|00005e20| 2c 20 4a 6f 68 6e 20 46 | 2e 20 48 61 75 67 68 20 |, John F|. Haugh |
|00005e30| 49 49 0a 20 2a 20 41 6c | 6c 20 72 69 67 68 74 73 |II. * Al|l rights|
|00005e40| 20 72 65 73 65 72 76 65 | 64 2e 0a 20 2a 0a 20 2a | reserve|d.. *. *|
|00005e50| 20 50 65 72 6d 69 73 73 | 69 6f 6e 20 69 73 20 67 | Permiss|ion is g|
|00005e60| 72 61 6e 74 65 64 20 74 | 6f 20 63 6f 70 79 20 61 |ranted t|o copy a|
|00005e70| 6e 64 20 63 72 65 61 74 | 65 20 64 65 72 69 76 61 |nd creat|e deriva|
|00005e80| 74 69 76 65 20 77 6f 72 | 6b 73 20 66 6f 72 20 61 |tive wor|ks for a|
|00005e90| 6e 79 0a 20 2a 20 6e 6f | 6e 2d 63 6f 6d 6d 65 72 |ny. * no|n-commer|
|00005ea0| 63 69 61 6c 20 70 75 72 | 70 6f 73 65 2c 20 70 72 |cial pur|pose, pr|
|00005eb0| 6f 76 69 64 65 64 20 74 | 68 69 73 20 63 6f 70 79 |ovided t|his copy|
|00005ec0| 72 69 67 68 74 20 6e 6f | 74 69 63 65 20 69 73 20 |right no|tice is |
|00005ed0| 70 72 65 73 65 72 76 65 | 64 0a 20 2a 20 69 6e 20 |preserve|d. * in |
|00005ee0| 61 6c 6c 20 63 6f 70 69 | 65 73 20 6f 66 20 73 6f |all copi|es of so|
|00005ef0| 75 72 63 65 20 63 6f 64 | 65 2c 20 6f 72 20 69 6e |urce cod|e, or in|
|00005f00| 63 6c 75 64 65 64 20 69 | 6e 20 68 75 6d 61 6e 20 |cluded i|n human |
|00005f10| 72 65 61 64 61 62 6c 65 | 20 66 6f 72 6d 0a 20 2a |readable| form. *|
|00005f20| 20 61 6e 64 20 63 6f 6e | 73 70 69 63 75 6f 75 73 | and con|spicuous|
|00005f30| 6c 79 20 64 69 73 70 6c | 61 79 65 64 20 6f 6e 20 |ly displ|ayed on |
|00005f40| 61 6c 6c 20 63 6f 70 69 | 65 73 20 6f 66 20 6f 62 |all copi|es of ob|
|00005f50| 6a 65 63 74 20 63 6f 64 | 65 20 6f 72 0a 20 2a 20 |ject cod|e or. * |
|00005f60| 64 69 73 74 72 69 62 75 | 74 69 6f 6e 20 6d 65 64 |distribu|tion med|
|00005f70| 69 61 2e 0a 20 2a 2f 0a | 0a 23 69 6e 63 6c 75 64 |ia.. */.|.#includ|
|00005f80| 65 20 3c 73 79 73 2f 74 | 79 70 65 73 2e 68 3e 0a |e <sys/t|ypes.h>.|
|00005f90| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 69 6f 2e |#include| <stdio.|
|00005fa0| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 66 63 6e |h>.#incl|ude <fcn|
|00005fb0| 74 6c 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |tl.h>.#i|nclude <|
|00005fc0| 73 69 67 6e 61 6c 2e 68 | 3e 0a 0a 23 69 66 6e 64 |signal.h|>..#ifnd|
|00005fd0| 65 66 09 6c 69 6e 74 0a | 73 74 61 74 69 63 09 63 |ef.lint.|static.c|
|00005fe0| 68 61 72 09 73 63 63 73 | 69 64 5b 5d 20 3d 20 22 |har.sccs|id[] = "|
|00005ff0| 40 28 23 29 63 68 66 6e | 2e 63 09 33 2e 38 09 31 |@(#)chfn|.c.3.8.1|
|00006000| 31 3a 35 39 3a 32 37 09 | 31 32 2f 32 38 2f 39 31 |1:59:27.|12/28/91|
|00006010| 22 3b 0a 23 65 6e 64 69 | 66 0a 0a 2f 2a 0a 20 2a |";.#endi|f../*. *|
|00006020| 20 53 65 74 20 75 70 20 | 73 6f 6d 65 20 42 53 44 | Set up |some BSD|
|00006030| 20 64 65 66 69 6e 65 73 | 20 73 6f 20 74 68 61 74 | defines| so that|
|00006040| 20 61 6c 6c 20 74 68 65 | 20 42 53 44 20 69 66 64 | all the| BSD ifd|
|00006050| 65 66 27 73 20 61 72 65 | 0a 20 2a 20 6b 65 70 74 |ef's are|. * kept|
|00006060| 20 72 69 67 68 74 20 68 | 65 72 65 20 0a 20 2a 2f | right h|ere . */|
|00006070| 0a 0a 23 69 66 6e 64 65 | 66 09 42 53 44 0a 23 69 |..#ifnde|f.BSD.#i|
|00006080| 6e 63 6c 75 64 65 20 3c | 73 74 72 69 6e 67 2e 68 |nclude <|string.h|
|00006090| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 3c 6d 65 6d 6f |>.#inclu|de <memo|
|000060a0| 72 79 2e 68 3e 0a 23 65 | 6c 73 65 0a 23 69 6e 63 |ry.h>.#e|lse.#inc|
|000060b0| 6c 75 64 65 20 3c 73 74 | 72 69 6e 67 73 2e 68 3e |lude <st|rings.h>|
|000060c0| 0a 23 64 65 66 69 6e 65 | 09 73 74 72 63 68 72 09 |.#define|.strchr.|
|000060d0| 69 6e 64 65 78 0a 23 64 | 65 66 69 6e 65 09 73 74 |index.#d|efine.st|
|000060e0| 72 72 63 68 72 09 72 69 | 6e 64 65 78 0a 23 65 6e |rrchr.ri|ndex.#en|
|000060f0| 64 69 66 0a 0a 23 69 6e | 63 6c 75 64 65 20 22 63 |dif..#in|clude "c|
|00006100| 6f 6e 66 69 67 2e 68 22 | 0a 23 69 6e 63 6c 75 64 |onfig.h"|.#includ|
|00006110| 65 20 22 70 77 64 2e 68 | 22 0a 0a 23 69 66 64 65 |e "pwd.h|"..#ifde|
|00006120| 66 09 55 53 45 5f 53 59 | 53 4c 4f 47 0a 23 69 6e |f.USE_SY|SLOG.#in|
|00006130| 63 6c 75 64 65 20 3c 73 | 79 73 6c 6f 67 2e 68 3e |clude <s|yslog.h>|
|00006140| 0a 0a 23 69 66 6e 64 65 | 66 09 4c 4f 47 5f 57 41 |..#ifnde|f.LOG_WA|
|00006150| 52 4e 0a 23 64 65 66 69 | 6e 65 09 4c 4f 47 5f 57 |RN.#defi|ne.LOG_W|
|00006160| 41 52 4e 20 4c 4f 47 5f | 57 41 52 4e 49 4e 47 0a |ARN LOG_|WARNING.|
|00006170| 23 65 6e 64 69 66 0a 23 | 65 6e 64 69 66 0a 23 69 |#endif.#|endif.#i|
|00006180| 66 64 65 66 09 55 53 45 | 5f 52 4c 49 4d 49 54 0a |fdef.USE|_RLIMIT.|
|00006190| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 72 65 |#include| <sys/re|
|000061a0| 73 6f 75 72 63 65 2e 68 | 3e 0a 0a 73 74 72 75 63 |source.h|>..struc|
|000061b0| 74 09 72 6c 69 6d 69 74 | 09 72 6c 69 6d 69 74 5f |t.rlimit|.rlimit_|
|000061c0| 66 73 69 7a 65 20 3d 20 | 7b 20 52 4c 49 4d 5f 49 |fsize = |{ RLIM_I|
|000061d0| 4e 46 49 4e 49 54 59 2c | 20 52 4c 49 4d 5f 49 4e |NFINITY,| RLIM_IN|
|000061e0| 46 49 4e 49 54 20 7d 3b | 0a 23 65 6e 64 69 66 0a |FINIT };|.#endif.|
|000061f0| 0a 2f 2a 0a 20 2a 20 47 | 6c 6f 62 61 6c 20 76 61 |./*. * G|lobal va|
|00006200| 72 69 61 62 6c 65 73 2e | 0a 20 2a 2f 0a 0a 63 68 |riables.|. */..ch|
|00006210| 61 72 09 2a 50 72 6f 67 | 6e 61 6d 65 3b 0a 63 68 |ar.*Prog|name;.ch|
|00006220| 61 72 09 75 73 65 72 5b | 42 55 46 53 49 5a 5d 3b |ar.user[|BUFSIZ];|
|00006230| 0a 63 68 61 72 09 66 75 | 6c 6c 6e 6d 5b 42 55 46 |.char.fu|llnm[BUF|
|00006240| 53 49 5a 5d 3b 0a 63 68 | 61 72 09 72 6f 6f 6d 6e |SIZ];.ch|ar.roomn|
|00006250| 6f 5b 42 55 46 53 49 5a | 5d 3b 0a 63 68 61 72 09 |o[BUFSIZ|];.char.|
|00006260| 77 6f 72 6b 70 68 5b 42 | 55 46 53 49 5a 5d 3b 0a |workph[B|UFSIZ];.|
|00006270| 63 68 61 72 09 68 6f 6d | 65 70 68 5b 42 55 46 53 |char.hom|eph[BUFS|
|00006280| 49 5a 5d 3b 0a 63 68 61 | 72 09 73 6c 6f 70 5b 42 |IZ];.cha|r.slop[B|
|00006290| 55 46 53 49 5a 5d 3b 0a | 69 6e 74 09 61 6d 72 6f |UFSIZ];.|int.amro|
|000062a0| 6f 74 3b 0a 0a 2f 2a 0a | 20 2a 20 45 78 74 65 72 |ot;../*.| * Exter|
|000062b0| 6e 61 6c 20 69 64 65 6e | 74 69 66 69 65 72 73 0a |nal iden|tifiers.|
|000062c0| 20 2a 2f 0a 0a 65 78 74 | 65 72 6e 09 69 6e 74 09 | */..ext|ern.int.|
|000062d0| 6f 70 74 69 6e 64 3b 0a | 65 78 74 65 72 6e 09 63 |optind;.|extern.c|
|000062e0| 68 61 72 09 2a 6f 70 74 | 61 72 67 3b 0a 65 78 74 |har.*opt|arg;.ext|
|000062f0| 65 72 6e 09 73 74 72 75 | 63 74 09 70 61 73 73 77 |ern.stru|ct.passw|
|00006300| 64 09 2a 67 65 74 70 77 | 75 69 64 20 28 29 3b 0a |d.*getpw|uid ();.|
|00006310| 65 78 74 65 72 6e 09 73 | 74 72 75 63 74 09 70 61 |extern.s|truct.pa|
|00006320| 73 73 77 64 09 2a 67 65 | 74 70 77 6e 61 6d 20 28 |sswd.*ge|tpwnam (|
|00006330| 29 3b 0a 65 78 74 65 72 | 6e 09 63 68 61 72 09 2a |);.exter|n.char.*|
|00006340| 67 65 74 6c 6f 67 69 6e | 20 28 29 3b 0a 23 69 66 |getlogin| ();.#if|
|00006350| 64 65 66 09 4e 44 42 4d | 0a 65 78 74 65 72 6e 09 |def.NDBM|.extern.|
|00006360| 69 6e 74 09 70 77 5f 64 | 62 6d 5f 6d 6f 64 65 3b |int.pw_d|bm_mode;|
|00006370| 0a 23 65 6e 64 69 66 0a | 0a 2f 2a 0a 20 2a 20 23 |.#endif.|./*. * #|
|00006380| 64 65 66 69 6e 65 73 20 | 66 6f 72 20 6d 65 73 73 |defines |for mess|
|00006390| 61 67 65 73 2e 20 20 54 | 68 69 73 20 66 61 63 69 |ages. T|his faci|
|000063a0| 6c 69 74 69 65 73 20 66 | 6f 72 65 69 67 6e 20 6c |lities f|oreign l|
|000063b0| 61 6e 67 75 61 67 65 20 | 63 6f 6e 76 65 72 73 69 |anguage |conversi|
|000063c0| 6f 6e 0a 20 2a 20 73 69 | 6e 63 65 20 61 6c 6c 20 |on. * si|nce all |
|000063d0| 6d 65 73 73 61 67 65 73 | 20 61 72 65 20 64 65 66 |messages| are def|
|000063e0| 69 6e 65 64 20 72 69 67 | 68 74 20 68 65 72 65 2e |ined rig|ht here.|
|000063f0| 0a 20 2a 2f 0a 0a 23 64 | 65 66 69 6e 65 09 55 53 |. */..#d|efine.US|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.